Skip to content

Commit

Permalink
Fix: keep prev spending limits when polling
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Aug 14, 2023
1 parent 085aebc commit 70ed756
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/hooks/loadables/useLoadSpendingLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ export const useLoadSpendingLimits = (): AsyncResult<SpendingLimitState[]> => {
const provider = useWeb3ReadOnly()
const tokenInfoFromBalances = useAppSelector(selectTokens, isEqual)

const [data, error, loading] = useAsync<SpendingLimitState[] | undefined>(() => {
if (!provider || !safeLoaded || !safe.modules || !tokenInfoFromBalances) return
const [data, error, loading] = useAsync<SpendingLimitState[] | undefined>(
() => {
if (!provider || !safeLoaded || !safe.modules || !tokenInfoFromBalances) return

return getSpendingLimits(provider, safe.modules, safeAddress, chainId, tokenInfoFromBalances)
return getSpendingLimits(provider, safe.modules, safeAddress, chainId, tokenInfoFromBalances)
},
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [provider, safeLoaded, safe.modules, tokenInfoFromBalances, safeAddress, chainId, safe.txHistoryTag])
[provider, safeLoaded, safe.modules, tokenInfoFromBalances, safeAddress, chainId, safe.txHistoryTag],
false,
)

useEffect(() => {
if (error) {
Expand Down

0 comments on commit 70ed756

Please sign in to comment.