Skip to content

Commit

Permalink
fix: use staletime instead of gcTime to avoid extra balance rpc reque…
Browse files Browse the repository at this point in the history
…sts (balancer#1058)

* fix: use staletime instead of gcTime to avoid extra balance rpc requests

* chore: add comment
  • Loading branch information
agualis authored Sep 6, 2024
1 parent 4c58e42 commit ef3b8a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/modules/tokens/TokenBalancesProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export function _useTokenBalances(initTokens?: GqlToken[], extTokens?: GqlToken[
address: userAddress,
query: {
enabled: !!userAddress && includesNativeAsset,
gcTime: BALANCE_CACHE_TIME_MS,
/*
Cache without requests in the background
More info: https://tkdodo.eu/blog/practical-react-query#the-defaults-explained
*/
staleTime: BALANCE_CACHE_TIME_MS,
},
})

Expand Down

0 comments on commit ef3b8a4

Please sign in to comment.