diff --git a/packages/app-providers/src/walletProvider.tsx b/packages/app-providers/src/walletProvider.tsx index b2e6500..247f306 100644 --- a/packages/app-providers/src/walletProvider.tsx +++ b/packages/app-providers/src/walletProvider.tsx @@ -166,6 +166,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => { const [isCorrectEthereumChain, setCorrectEthereumChain] = useState(false); const [multisigMigrationStatus, setMultisigMigrationStatus] = useState(); const [isCheckingMultisigCompleted, setIsCheckingMultisigCompleted] = useState(false); + const [selectedChainId, setSelectedChainId] = useState(); const { currentBlock } = useBlock(apiPromise); const { getAccountAsset, isLoadingWalletLedger } = useLedger({ @@ -217,7 +218,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => { /*This will be fired once the connection to the wallet is successful*/ useEffect(() => { - if (!selectedNetwork) { + if (!selectedNetwork || !isEthereumWalletConnected) { return; } //refresh the page with the newly selected account @@ -230,7 +231,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => { ); setProvider(newProvider); setMultisigContract(multisigContract); - }, [selectedNetwork]); + }, [selectedNetwork, isEthereumWalletConnected]); const disconnectWallet = useCallback(() => { setSelectedAccount(undefined);