diff --git a/packages/connectkit/src/components/BalanceButton/index.tsx b/packages/connectkit/src/components/BalanceButton/index.tsx index d07533ca..394860cd 100644 --- a/packages/connectkit/src/components/BalanceButton/index.tsx +++ b/packages/connectkit/src/components/BalanceButton/index.tsx @@ -53,7 +53,7 @@ export const Balance: React.FC = ({ hideIcon, hideSymbol }) => { const { address, chain } = useAccount(); const chains = useChains(); - const unsupported = useChainIsSupported(chain?.id); + const isChainSupported = useChainIsSupported(chain?.id); const queryClient = useQueryClient(); const { data: blockNumber } = useBlockNumber({ watch: true }); @@ -105,7 +105,7 @@ export const Balance: React.FC = ({ hideIcon, hideSymbol }) => { > {!address || !isMounted || balance?.formatted === undefined ? ( - {!hideIcon && } + {!hideIcon && } @@ -114,7 +114,7 @@ export const Balance: React.FC = ({ hideIcon, hideSymbol }) => { - ) : unsupported ? ( + ) : !isChainSupported ? ( {!hideIcon && } ??? diff --git a/packages/connectkit/src/hooks/useChainIsSupported.ts b/packages/connectkit/src/hooks/useChainIsSupported.ts index 5aacdd84..6db940d7 100644 --- a/packages/connectkit/src/hooks/useChainIsSupported.ts +++ b/packages/connectkit/src/hooks/useChainIsSupported.ts @@ -1,7 +1,7 @@ import { useConfig } from 'wagmi'; export function useChainIsSupported(chainId?: number): boolean | null { - if (!chainId) return false; const { chains } = useConfig(); + if (!chainId) return false; return chains.some((x) => x.id === chainId); }