v2.0.6 and use feature flag for auto repay (#650)
This commit is contained in:
parent
0cc58b6e84
commit
5469d708cb
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mars-v2-frontend",
|
"name": "mars-v2-frontend",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn validate-env && next build",
|
"build": "yarn validate-env && next build",
|
||||||
|
@ -27,7 +27,7 @@ import { useUpdatedAccount } from 'hooks/useUpdatedAccount'
|
|||||||
import useStore from 'store'
|
import useStore from 'store'
|
||||||
import { BNCoin } from 'types/classes/BNCoin'
|
import { BNCoin } from 'types/classes/BNCoin'
|
||||||
import { byDenom } from 'utils/array'
|
import { byDenom } from 'utils/array'
|
||||||
import { defaultFee } from 'utils/constants'
|
import { defaultFee, ENABLE_AUTO_REPAY } from 'utils/constants'
|
||||||
import { getCapLeftWithBuffer } from 'utils/generic'
|
import { getCapLeftWithBuffer } from 'utils/generic'
|
||||||
import { asyncThrottle, BN } from 'utils/helpers'
|
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 isBorrowEnabled = !!marketAssets.find(byDenom(sellAsset.denom))?.borrowEnabled
|
||||||
const isRepayable = !!account?.debts.find(byDenom(buyAsset.denom))
|
const isRepayable = !!account?.debts.find(byDenom(buyAsset.denom))
|
||||||
const [isMarginChecked, setMarginChecked] = useToggle(isBorrowEnabled ? useMargin : false)
|
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 [buyAssetAmount, setBuyAssetAmount] = useState(BN_ZERO)
|
||||||
const [sellAssetAmount, setSellAssetAmount] = useState(BN_ZERO)
|
const [sellAssetAmount, setSellAssetAmount] = useState(BN_ZERO)
|
||||||
const [maxBuyableAmountEstimation, setMaxBuyableAmountEstimation] = useState(BN_ZERO)
|
const [maxBuyableAmountEstimation, setMaxBuyableAmountEstimation] = useState(BN_ZERO)
|
||||||
@ -314,7 +316,7 @@ export default function SwapForm(props: Props) {
|
|||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{isRepayable && (
|
{isRepayable && ENABLE_AUTO_REPAY && (
|
||||||
<AutoRepayToggle
|
<AutoRepayToggle
|
||||||
checked={isAutoRepayChecked}
|
checked={isAutoRepayChecked}
|
||||||
onChange={handleAutoRepayToggleChange}
|
onChange={handleAutoRepayToggleChange}
|
||||||
|
@ -22,3 +22,4 @@ export const DEFAULT_PORTFOLIO_STATS = [
|
|||||||
|
|
||||||
export const ENABLE_HLS = false
|
export const ENABLE_HLS = false
|
||||||
export const ENABLE_PERPS = false
|
export const ENABLE_PERPS = false
|
||||||
|
export const ENABLE_AUTO_REPAY = false
|
||||||
|
Loading…
Reference in New Issue
Block a user