From 067544d391d633ec984328260248e370018c8f71 Mon Sep 17 00:00:00 2001 From: Georges KABBOUCHI Date: Thu, 5 Aug 2021 20:50:45 +0300 Subject: [PATCH] fix --- .../sidebar/context/aaveV2/SidebarAaveV2Withdraw.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/sidebar/context/aaveV2/SidebarAaveV2Withdraw.vue b/components/sidebar/context/aaveV2/SidebarAaveV2Withdraw.vue index 764f8df..06969a8 100644 --- a/components/sidebar/context/aaveV2/SidebarAaveV2Withdraw.vue +++ b/components/sidebar/context/aaveV2/SidebarAaveV2Withdraw.vue @@ -6,7 +6,7 @@ - +
@@ -98,16 +98,17 @@ export default defineComponent({ const { networkName, account } = useWeb3() const { dsa } = useDSA() const { getTokenByKey, valInt } = useToken() - const { fetchBalances } = useBalances() const { formatNumber, formatUsdMax, formatUsd } = useFormatting() const { isZero, gt, plus, max, minus } = useBigNumber() const { parseSafeFloat } = useParsing() const { showPendingTransaction } = useNotification() - + const originalBalance = ref('0') const { stats, status, displayPositions, maxLiquidation, liquidationPrice, liquidationMaxPrice } = useAaveV2Position({ overridePosition: (position) => { if (rootTokenKey.value !== position.key) return position + originalBalance.value = position.supply + return { ...position, supply: max(minus(position.supply, amountParsed.value), '0').toFixed(), @@ -149,7 +150,7 @@ export default defineComponent({ : null return { - amount: { message: validateAmount(amountParsed.value, balance.value), show: hasAmountValue }, + amount: { message: validateAmount(amountParsed.value, originalBalance.value), show: hasAmountValue }, liquidation: { message: liqValid, show: hasAmountValue }, auth: { message: validateIsLoggedIn(!!account.value), show: true }, liquidity: { @@ -196,6 +197,7 @@ export default defineComponent({ rootTokenKey, token, symbol, + originalBalance, balance, formatNumber, formatUsdMax,