Skip to content

Commit

Permalink
fix: issue YEA-586
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Aug 5, 2024
1 parent 1a9cf9c commit c053f12
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/vaults-v3/components/details/actions/QuickActionsFrom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
formatAmount,
formatCounterValue,
handleInputChangeEventValue,
isAddress,
isEthAddress,
isZeroAddress,
MULTICALL3_ADDRESS,
Expand Down Expand Up @@ -156,10 +157,12 @@ export function VaultDetailsQuickActionsFrom(): ReactElement {
address: toAddress(actionParams?.selectedOptionFrom?.value),
chainID: Number(actionParams?.selectedOptionFrom?.chainID)
});
const userBalance = useMemo(
() => (!onChainBalance ? cachedBalance : onChainBalance),
[cachedBalance, onChainBalance]
);
const userBalance = useMemo(() => {
if (!isAddress(address)) {
return zeroNormalizedBN;
}
return !onChainBalance ? cachedBalance : onChainBalance;
}, [address, cachedBalance, onChainBalance]);
useEffect(() => {
refetch();
}, [blockNumber, refetch]);
Expand Down

0 comments on commit c053f12

Please sign in to comment.