Skip to content

Commit

Permalink
Revert "resolve max withdraw bug"
Browse files Browse the repository at this point in the history
This reverts commit 205892b.
  • Loading branch information
fishonamos committed Sep 10, 2024
1 parent bd16ce9 commit cc2037c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ export default function Deposit(props: DepositProps) {
}, [balData]);
// const { balance, isLoading, isError } = useERC20Balance(selectedMarket);
const maxAmount: MyNumber = useMemo(() => {
if (props.buttonText === 'Redeem') {
return balance;
}

const currentTVl = tvlInfo.data?.amount || MyNumber.fromZero();
const maxAllowed =
props.strategy.settings.maxTVL - Number(currentTVl.toEtherStr());
Expand All @@ -121,7 +117,7 @@ export default function Deposit(props: DepositProps) {
console.log('Deposit:: reducedBalance2', reducedBalance.toEtherStr());
const min = MyNumber.min(reducedBalance, adjustedMaxAllowed);
return MyNumber.max(min, MyNumber.fromEther('0', selectedMarket.decimals));
}, [balance, props.strategy, selectedMarket, props.buttonText, tvlInfo]);
}, [balance, props.strategy, selectedMarket]);

function BalanceComponent(props: {
token: TokenInfo;
Expand Down

0 comments on commit cc2037c

Please sign in to comment.