Skip to content

Commit

Permalink
fixed the problem where the ethereum address failed to auto generate
Browse files Browse the repository at this point in the history
  • Loading branch information
isunaslabs committed Apr 7, 2023
1 parent 95cc91e commit 9c5c590
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/app-providers/src/walletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => {
const [isCorrectEthereumChain, setCorrectEthereumChain] = useState<boolean>(false);
const [multisigMigrationStatus, setMultisigMigrationStatus] = useState<DarwiniaSourceAccountMigrationMultisig>();
const [isCheckingMultisigCompleted, setIsCheckingMultisigCompleted] = useState<boolean>(false);
const [selectedChainId, setSelectedChainId] = useState();

const { currentBlock } = useBlock(apiPromise);
const { getAccountAsset, isLoadingWalletLedger } = useLedger({
Expand Down Expand Up @@ -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
Expand All @@ -230,7 +231,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => {
);
setProvider(newProvider);
setMultisigContract(multisigContract);
}, [selectedNetwork]);
}, [selectedNetwork, isEthereumWalletConnected]);

const disconnectWallet = useCallback(() => {
setSelectedAccount(undefined);
Expand Down

0 comments on commit 9c5c590

Please sign in to comment.