Skip to content

Commit

Permalink
fix(depositform): max input value (#246)
Browse files Browse the repository at this point in the history
* fix(depositform): max input value

* chore(linting): added deps to use memo hook
  • Loading branch information
fritzschoff authored Apr 18, 2024
1 parent 77ac0f1 commit 41da4bd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion liquidity/ui/src/components/Accounts/Deposit/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,23 @@ export function DepositFormUi({
if (collateralType?.symbol === 'SNX') {
return snxBalance?.transferable;
}
if (collateralType?.symbol === 'USDC') {
return tokenBalance?.add(accountCollateral?.availableCollateral);
}
if (collateralType?.symbol !== 'WETH') {
return tokenBalance;
}
if (!tokenBalance || !ethBalance) {
return undefined;
}
return tokenBalance.add(ethBalance);
}, [collateralType?.symbol, tokenBalance, ethBalance, snxBalance?.transferable]);
}, [
collateralType?.symbol,
tokenBalance,
ethBalance,
snxBalance?.transferable,
accountCollateral?.availableCollateral,
]);

const [isOpenDeposit, setIsOpenDeposit] = useState(false);

Expand Down

0 comments on commit 41da4bd

Please sign in to comment.