From 27fa16dfe1960b4b5aa4c1bf74e09dccb0c51dce Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 Aug 2024 18:14:38 +0530 Subject: [PATCH] fix withdraw deddudction issue --- src/components/Deposit.tsx | 18 ++++++++++-------- src/components/TVL.tsx | 7 ++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/Deposit.tsx b/src/components/Deposit.tsx index 299c463..9d3b7ca 100755 --- a/src/components/Deposit.tsx +++ b/src/components/Deposit.tsx @@ -104,14 +104,16 @@ export default function Deposit(props: DepositProps) { ); let reducedBalance = balance; - if (selectedMarket.name === 'STRK') { - reducedBalance = balance.subtract( - MyNumber.fromEther('1.5', selectedMarket.decimals), - ); - } else if (selectedMarket.name === 'ETH') { - reducedBalance = balance.subtract( - MyNumber.fromEther('0.001', selectedMarket.decimals), - ); + if (props.buttonText === 'Deposit') { + if (selectedMarket.name === 'STRK') { + reducedBalance = balance.subtract( + MyNumber.fromEther('1.5', selectedMarket.decimals), + ); + } else if (selectedMarket.name === 'ETH') { + reducedBalance = balance.subtract( + MyNumber.fromEther('0.001', selectedMarket.decimals), + ); + } } console.log('Deposit:: reducedBalance2', reducedBalance.toEtherStr()); const min = MyNumber.min(reducedBalance, adjustedMaxAllowed); diff --git a/src/components/TVL.tsx b/src/components/TVL.tsx index 109a451..6fb6432 100755 --- a/src/components/TVL.tsx +++ b/src/components/TVL.tsx @@ -88,7 +88,12 @@ const TVL: React.FC = () => { Your referral link{' '} {/* TODO: update the url */} - (i) + + (i) +