Skip to content

Commit

Permalink
Fix userAssets loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Jan 6, 2025
1 parent 3bb8e9a commit 4b2d321
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/state/assets/userAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function deserializeUserAssetsState(serializedState: string) {
}

const { state, version } = parsedState;
let userAssetsDataExists = false;

let chainBalances = new Map<ChainId, number>();
try {
Expand All @@ -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 });
Expand All @@ -205,6 +207,7 @@ function deserializeUserAssetsState(serializedState: string) {
...state,
chainBalances,
idsByChain,
isLoadingUserAssets: !userAssetsDataExists,
userAssets: userAssetsData,
hiddenAssets,
},
Expand Down

0 comments on commit 4b2d321

Please sign in to comment.