From c3f907fe4f7703fbc995d6c980af838e13c4f2a4 Mon Sep 17 00:00:00 2001 From: Danica Shen Date: Fri, 25 Aug 2023 20:05:28 +0100 Subject: [PATCH] fix:fix error of balance fetching when add/import an account (#20612) --- ui/selectors/selectors.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index fecc756be..a88b92797 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -764,9 +764,8 @@ export function getWeb3ShimUsageStateForOrigin(state, origin) { export function getSwapsDefaultToken(state) { const selectedAccount = getSelectedAccount(state); - const { balance } = selectedAccount; + const balance = selectedAccount?.balance; const chainId = getCurrentChainId(state); - const defaultTokenObject = SWAPS_CHAINID_DEFAULT_TOKEN_MAP[chainId]; return {