From 4b2d32195ab34ea0f3b2a757605955e2f44cd675 Mon Sep 17 00:00:00 2001 From: Christian Baroni <7061887+christianbaroni@users.noreply.github.com> Date: Mon, 6 Jan 2025 20:33:41 +0000 Subject: [PATCH] Fix userAssets loading state --- src/state/assets/userAssets.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/state/assets/userAssets.ts b/src/state/assets/userAssets.ts index d667880acdb..e6595d0f9aa 100644 --- a/src/state/assets/userAssets.ts +++ b/src/state/assets/userAssets.ts @@ -163,6 +163,7 @@ function deserializeUserAssetsState(serializedState: string) { } const { state, version } = parsedState; + let userAssetsDataExists = false; let chainBalances = new Map(); try { @@ -186,6 +187,7 @@ function deserializeUserAssetsState(serializedState: string) { try { if (state.userAssets.length) { userAssetsData = new Map(state.userAssets); + userAssetsDataExists = true; } } catch (error) { logger.error(new RainbowError(`[userAssetsStore]: Failed to convert userAssets from user assets storage`), { error }); @@ -205,6 +207,7 @@ function deserializeUserAssetsState(serializedState: string) { ...state, chainBalances, idsByChain, + isLoadingUserAssets: !userAssetsDataExists, userAssets: userAssetsData, hiddenAssets, },