diff --git a/src/routes/tokens/store/actions/fetchTokens.js b/src/routes/tokens/store/actions/fetchTokens.js index 349c045e..64a03d05 100644 --- a/src/routes/tokens/store/actions/fetchTokens.js +++ b/src/routes/tokens/store/actions/fetchTokens.js @@ -41,8 +41,9 @@ export const fetchTokens = (safeAddress: string) => try { const balancesRecords = await Promise.all(json.map(async (item: TokenProps) => { - const funds = await calculateBalanceOf(item.address, safeAddress, item.decimals) const status = tokens.includes(item.address) + const funds = status ? await calculateBalanceOf(item.address, safeAddress, item.decimals) : '0' + return makeToken({ ...item, status, funds }) })) diff --git a/src/routes/tokens/store/selectors/index.js b/src/routes/tokens/store/selectors/index.js index 4925e95d..2339dcb5 100644 --- a/src/routes/tokens/store/selectors/index.js +++ b/src/routes/tokens/store/selectors/index.js @@ -5,7 +5,6 @@ import { safeParamAddressSelector, type RouterProps } from '~/routes/safe/store/ import { type GlobalState } from '~/store' import { TOKEN_REDUCER_ID } from '~/routes/tokens/store/reducer/tokens' import { type Token } from '~/routes/tokens/store/model/token' -import { calculateActiveErc20TokensFrom } from '~/utils/tokens' const balancesSelector = (state: GlobalState) => state[TOKEN_REDUCER_ID] @@ -40,8 +39,3 @@ export const tokenAddressesSelector = createSelector( return addresses }, ) - -export const activeTokenAddressesSelector = createSelector( - tokenListSelector, - (balances: List) => calculateActiveErc20TokensFrom(balances), -)