Skip to content

Commit

Permalink
fix: connect onboard in hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Sep 12, 2022
1 parent 5815a0e commit 0749867
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/views/Claim/hooks/useClaimView.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useConnection } from "state/hooks";
import { onboard } from "utils";

import { useMerkleDistributor } from "./useMerkleDistributor";
import { useAirdropRecipient } from "./useAirdropRecipient";

export function useClaimView() {
const { init } = onboard;
const { isConnected, provider } = useConnection();
const { isConnected, provider, connect } = useConnection();

const airdropRecipientQuery = useAirdropRecipient();
const { handleClaim, claimState, hasClaimedState } = useMerkleDistributor();
Expand All @@ -26,7 +24,7 @@ export function useClaimView() {
};

return {
handleConnectWallet: init,
handleConnectWallet: () => connect(),
handleAddTokenToWallet,
isConnected,
airdropRecipientQuery,
Expand Down
5 changes: 2 additions & 3 deletions src/views/Staking/hooks/useStakingView.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useConnection } from "state/hooks";
import { onboard } from "utils";
import { useStakingActionsResolver } from "./useStakingActionsResolver";
import { useStakingPoolResolver } from "./useStakingPoolResolver";

export const useStakingView = () => {
const { isConnected, provider } = useConnection();
const { isConnected, provider, connect } = useConnection();
const { poolId, exitLinkURI, poolLogoURI, poolName, mainnetAddress } =
useStakingPoolResolver();

Expand All @@ -27,6 +26,6 @@ export const useStakingView = () => {
stakingData,
isConnected,
provider,
connectWalletHandler: onboard.init,
connectWalletHandler: () => connect(),
};
};
2 changes: 1 addition & 1 deletion src/views/Transactions/MyTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useMyTransactionsView } from "./hooks/useMyTransactionsView";
import { ConnectButton, Account, ButtonWrapper } from "./Transactions.styles";
import { TransactionsLayout } from "./components/TransactionsLayout";

export default function MyTransactions() {
export function MyTransactions() {
const {
connectWallet,
account,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19105,7 +19105,7 @@ is-buffer@^1.1.5:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==

is-buffer@^2.0.2, is-buffer@^2.0.5, is-buffer@~2.0.3:
is-buffer@^2.0.0, is-buffer@^2.0.2, is-buffer@^2.0.5, is-buffer@~2.0.3:
version "2.0.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191"
integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==
Expand Down

0 comments on commit 0749867

Please sign in to comment.