Skip to content

Commit 3b2c4e5

Browse files
committed
fix: enhance UnsupportedChain component to handle unsupported chains when disconnected
1 parent b3a23ab commit 3b2c4e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/UnsupportedChain.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { Alert, AlertDescription, AlertTitle } from './ui/alert';
66
const SUPPORTED_CHAIN_IDS = SUPPORTED_CHAINS.map((chain) => chain.id);
77

88
export function UnsupportedChain() {
9-
const { chainId } = useUserStore();
9+
const { isConnected, chainId } = useUserStore();
1010

1111
const isChainSupported =
1212
chainId !== undefined && SUPPORTED_CHAIN_IDS.includes(chainId);
1313

14-
if (isChainSupported) {
14+
if (isChainSupported || !isConnected) {
1515
return null;
1616
}
1717

0 commit comments

Comments
 (0)