diff --git a/src/logic/tokens/store/actions/activateTokensByBalance.js b/src/logic/tokens/store/actions/activateTokensByBalance.js index a946535f..5cf8cc75 100644 --- a/src/logic/tokens/store/actions/activateTokensByBalance.js +++ b/src/logic/tokens/store/actions/activateTokensByBalance.js @@ -25,17 +25,24 @@ const activateTokensByBalance = (safeAddress: string) => async ( // balances: tokens' balance returned by the backend const { addresses, balances } = result.data.reduce((acc, { tokenAddress, balance }) => ({ addresses: [...acc.addresses, tokenAddress], - balances: [...acc.balances, balance], - }), { addresses: [], balances: [] }) + balances: [[tokenAddress, balance]], + }), { + addresses: [], + balances: [], + }) // update balance list for the safe - dispatch(updateSafe({ address: safeAddress, balances: Set(balances) })) + dispatch(updateSafe({ + address: safeAddress, + balances: Set(balances), + })) // active tokens by balance, excluding those already blacklisted and the `null` address const activeByBalance = addresses.filter((address) => address !== null && !blacklistedTokens.includes(address)) // need to persist those already active tokens, despite its balances - const activeTokens = alreadyActiveTokens.toSet().union(activeByBalance) + const activeTokens = alreadyActiveTokens.toSet() + .union(activeByBalance) // update list of active tokens dispatch(updateActiveTokens(safeAddress, activeTokens)) diff --git a/src/utils/storage/index.js b/src/utils/storage/index.js index 01c3d3aa..448b22aa 100644 --- a/src/utils/storage/index.js +++ b/src/utils/storage/index.js @@ -8,7 +8,7 @@ import { getNetwork } from '~/config' const stores = [IndexedDbStore, LocalStorageStore] export const storage = new ImmortalStorage(stores) -const PREFIX = `v1_${getNetwork()}` +const PREFIX = `v2_${getNetwork()}` export const loadFromStorage = async (key: string): Promise<*> => { try {