Skip to content

Commit

Permalink
fix occasional failure to detect changes in USDC balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryz0nd committed Apr 16, 2024
1 parent bd93d06 commit f0ef9f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useSubaccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ export const useSubaccountContext = ({ localDydxWallet }: { localDydxWallet?: Lo
);

const balances = useSelector(getBalances, shallowEqual);
const usdcCoinBalance = balances?.[usdcDenom];

useEffect(() => {
const usdcCoinBalance = balances?.[usdcDenom];
if (usdcCoinBalance) {
depositFunds(usdcCoinBalance);
}
}, [usdcCoinBalance]);
}, [balances, usdcDenom, depositFunds]);

const deposit = useCallback(
async (amount: number) => {
Expand Down

0 comments on commit f0ef9f6

Please sign in to comment.