fix: fixed dust left when trying to buy max amount without leverage (#565)
This commit is contained in:
parent
2b0173f01e
commit
40c2e8039a
@ -241,6 +241,11 @@ export default function SwapForm(props: Props) {
|
|||||||
}
|
}
|
||||||
}, [account?.id, swapTx, setIsConfirming])
|
}, [account?.id, swapTx, setIsConfirming])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (sellAssetAmount.isEqualTo(maxSellAmount) || buyAssetAmount.isZero()) return
|
||||||
|
if (buyAssetAmount.isEqualTo(maxBuyableAmountEstimation)) setSellAssetAmount(maxSellAmount)
|
||||||
|
}, [sellAssetAmount, maxSellAmount, buyAssetAmount, maxBuyableAmountEstimation])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
Loading…
Reference in New Issue
Block a user