diff --git a/package.json b/package.json index 1aa5f1ff..c6a2d52e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "2.0.5", + "version": "2.0.6", "private": true, "scripts": { "build": "yarn validate-env && next build", diff --git a/src/components/Trade/TradeModule/SwapForm/index.tsx b/src/components/Trade/TradeModule/SwapForm/index.tsx index a52d9e17..4c47d6be 100644 --- a/src/components/Trade/TradeModule/SwapForm/index.tsx +++ b/src/components/Trade/TradeModule/SwapForm/index.tsx @@ -27,7 +27,7 @@ import { useUpdatedAccount } from 'hooks/useUpdatedAccount' import useStore from 'store' import { BNCoin } from 'types/classes/BNCoin' import { byDenom } from 'utils/array' -import { defaultFee } from 'utils/constants' +import { defaultFee, ENABLE_AUTO_REPAY } from 'utils/constants' import { getCapLeftWithBuffer } from 'utils/generic' import { asyncThrottle, BN } from 'utils/helpers' @@ -50,7 +50,9 @@ export default function SwapForm(props: Props) { const isBorrowEnabled = !!marketAssets.find(byDenom(sellAsset.denom))?.borrowEnabled const isRepayable = !!account?.debts.find(byDenom(buyAsset.denom)) const [isMarginChecked, setMarginChecked] = useToggle(isBorrowEnabled ? useMargin : false) - const [isAutoRepayChecked, setAutoRepayChecked] = useToggle(isRepayable ? useAutoRepay : false) + const [isAutoRepayChecked, setAutoRepayChecked] = useToggle( + isRepayable && ENABLE_AUTO_REPAY ? useAutoRepay : false, + ) const [buyAssetAmount, setBuyAssetAmount] = useState(BN_ZERO) const [sellAssetAmount, setSellAssetAmount] = useState(BN_ZERO) const [maxBuyableAmountEstimation, setMaxBuyableAmountEstimation] = useState(BN_ZERO) @@ -314,7 +316,7 @@ export default function SwapForm(props: Props) { /> - {isRepayable && ( + {isRepayable && ENABLE_AUTO_REPAY && (