v2.0.6 and use feature flag for auto repay (#650)

This commit is contained in:
Bob van der Helm 2023-11-23 15:38:47 +01:00 committed by GitHub
parent 0cc58b6e84
commit 5469d708cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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",

View File

@ -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) {
/>
<Divider />
{isRepayable && (
{isRepayable && ENABLE_AUTO_REPAY && (
<AutoRepayToggle
checked={isAutoRepayChecked}
onChange={handleAutoRepayToggleChange}

View File

@ -22,3 +22,4 @@ export const DEFAULT_PORTFOLIO_STATS = [
export const ENABLE_HLS = false
export const ENABLE_PERPS = false
export const ENABLE_AUTO_REPAY = false