fix: prevent permanent account updates by trade page (#587)

This commit is contained in:
Linkie Link 2023-10-25 11:35:13 +02:00 committed by GitHub
parent fb798a33cf
commit 8435ed3498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,6 +209,8 @@ export default function SwapForm(props: Props) {
const addDebtAmount = sellAssetAmount.isGreaterThan(sellSideMarginThreshold)
? sellAssetAmount.minus(sellSideMarginThreshold)
: BN_ZERO
if (removeDepositAmount.isZero() && addDebtAmount.isZero() && buyAssetAmount.isZero()) return
const removeCoin = BNCoin.fromDenomAndBigNumber(sellAsset.denom, removeDepositAmount)
const debtCoin = BNCoin.fromDenomAndBigNumber(sellAsset.denom, addDebtAmount)
const addCoin = BNCoin.fromDenomAndBigNumber(buyAsset.denom, buyAssetAmount)