1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

Fixed balance error when creating a new EOA account (#20585)

This commit is contained in:
Albert Olivé 2023-08-24 11:01:30 +02:00 committed by GitHub
parent f36261a9a6
commit a478f675f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,8 +376,8 @@ export const getMetaMaskAccountsConnected = createSelector(
);
export function isBalanceCached(state) {
const selectedAccountBalance =
state.metamask.accounts[getSelectedAddress(state)].balance;
const selectedAccount = state.metamask.accounts[getSelectedAddress(state)];
const selectedAccountBalance = selectedAccount && selectedAccount.balance;
const cachedBalance = getSelectedAccountCachedBalance(state);
return Boolean(!selectedAccountBalance && cachedBalance);