Skip to content

Commit 2e7b414

Browse files
committed
handle the case where chain changes but no of wallets is unchanged
1 parent d2e4329 commit 2e7b414

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/modal/src/ui/components/ConnectWallet/ConnectWallet.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,14 @@ function ConnectWallet(props: ConnectWalletProps) {
153153
}, [walletDiscoverySupported, defaultButtons, installedWalletButtons, isShowAllWallets, totalExternalWalletsCount]);
154154

155155
// Automatically show all wallets if there are less than or equal to 15 wallets
156+
// also resets everytime we search causing no. of wallets to change or select different chain
156157
useEffect(() => {
157-
if (walletDiscoverySupported && totalExternalWalletsCount <= 15) {
158+
if (walletDiscoverySupported && totalExternalWalletsCount <= 14) {
158159
setIsShowAllWallets(true);
159160
} else {
160161
setIsShowAllWallets(false);
161162
}
162-
}, [walletDiscoverySupported, totalExternalWalletsCount]);
163+
}, [walletDiscoverySupported, selectedChain, totalExternalWalletsCount]);
163164

164165
/**
165166
* Wallet click logic

0 commit comments

Comments
 (0)