Skip to content

Commit

Permalink
Fixed WalletConnectButton menu popping up when selecting a wallet aft…
Browse files Browse the repository at this point in the history
…er clicking on the change wallet option
  • Loading branch information
Carson Aberle committed Jul 12, 2023
1 parent c7ae30d commit f00cb53
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-poets-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sei-js/react': patch
---

This fixes an issue where the wallet button menu pops up after connecting to a wallet
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const WalletConnectButton = ({ buttonClassName, primaryColor, secondaryColor, ba
}, [backgroundColor]);

const changeWallet = () => {
setShowConnectModal(true);
setShowMenu(false);
setShowConnectModal(true);
};

const copyAddress = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const WalletSelectModal = ({ wallets: inputWallets }: WalletSelectModalProps) =>
};

const selectWallet = async () => {
if (wallet.walletInfo.name === targetWallet?.walletInfo.name) return;
if (setTargetWallet) setTargetWallet(wallet);
setIsConnecting(true);
setConnectionError(undefined);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/lib/provider/SeiWalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const SeiWalletProvider = ({ children, chainConfiguration, wallets, autoConnect
return;
}

// const enableResponse = await targetWallet.connect(chainConfiguration.chainId);
const fetchedOfflineSigner = await targetWallet.getOfflineSigner(chainConfiguration.chainId);

if (!fetchedOfflineSigner) {
Expand Down

0 comments on commit f00cb53

Please sign in to comment.