Skip to content

Commit

Permalink
Update the balance cache in case of an error (#3288)
Browse files Browse the repository at this point in the history
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
  • Loading branch information
emreboga authored Feb 19, 2025
1 parent fab83cc commit 25228a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wormhole-connect/src/hooks/useGetTokenBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ const useGetTokenBalances = (
};
}
}

updateCache = true;
} catch (e) {
console.error('Failed to get token balances', e);
} finally {
// There can be failures for some tokens,
// but we'll still update the cache with latest balances
updateCache = true;
}
}
if (isActive) {
Expand Down

0 comments on commit 25228a7

Please sign in to comment.