Skip to content

Commit

Permalink
Merge pull request #26 from mars-protocol/v1.4.4
Browse files Browse the repository at this point in the history
release v1.4.4
  • Loading branch information
linkielink authored Apr 21, 2023
2 parents 0b15efb + 01fc911 commit 4ea8f54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions src/components/common/TxModal/Action.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'chart.js/auto'

import { Coin } from '@cosmjs/stargate'
import classNames from 'classnames'
import {
BorrowCapacity,
Expand All @@ -22,7 +21,7 @@ import {
maintainanceMarginWeightedDepositValue,
producePercentData,
} from 'libs/assetInfo'
import { formatValue, lookup, lookupSymbol, magnify } from 'libs/parse'
import { formatValue, lookup, lookupSymbol } from 'libs/parse'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Bar } from 'react-chartjs-2'
import { useTranslation } from 'react-i18next'
Expand All @@ -46,7 +45,6 @@ interface Props {
actionButtonSpec: ModalActionButton
submitted: boolean
feeError?: string
txFee?: Coin
activeView: ViewType
denom: string
decimals: number
Expand All @@ -67,7 +65,6 @@ export const Action = ({
actionButtonSpec,
submitted,
feeError,
txFee,
activeView,
denom,
decimals,
Expand Down Expand Up @@ -229,13 +226,8 @@ export const Action = ({
}, [denom, availableBalanceBaseCurrency, currentAssetPrice, marketAssetLiquidity])

const repayMax = useMemo((): number => {
let adjustedWalletBalance = walletBalance
if (denom === baseCurrency.denom) {
adjustedWalletBalance = walletBalance - Number(magnify(Number(txFee), 6))
}

return Math.min(assetBorrowBalance, adjustedWalletBalance)
}, [assetBorrowBalance, walletBalance, txFee, denom, baseCurrency.denom])
return Math.min(assetBorrowBalance, walletBalance)
}, [assetBorrowBalance, walletBalance, denom, baseCurrency.denom])

const maxWithdrawableAmount = useMemo((): number => {
const assetLtvRatio = findByDenom(marketInfo, denom)?.max_loan_to_value || 0
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ i18next
backend: {
crossDomain: true,
loadPath() {
return 'https://raw.githubusercontent.com/mars-protocol/translations/develop/{{lng}}.json'
return 'https://raw.githubusercontent.com/mars-protocol/translations/master/{{lng}}.json'
},
},
react: {
Expand Down

0 comments on commit 4ea8f54

Please sign in to comment.