fix(repay): transaction message when selecting max amount & unused vars (#423)
This commit is contained in:
parent
270f2e1c58
commit
b7019023f0
@ -54,7 +54,6 @@ export default function BorrowModalController() {
|
||||
|
||||
function BorrowModal(props: Props) {
|
||||
const { modal, account } = props
|
||||
const [percentage, setPercentage] = useState(0)
|
||||
const [amount, setAmount] = useState(BN_ZERO)
|
||||
const [isConfirming, setIsConfirming] = useToggle()
|
||||
const [borrowToWallet, setBorrowToWallet] = useToggle()
|
||||
@ -71,7 +70,6 @@ function BorrowModal(props: Props) {
|
||||
|
||||
function resetState() {
|
||||
setAmount(BN_ZERO)
|
||||
setPercentage(0)
|
||||
setIsConfirming(false)
|
||||
}
|
||||
|
||||
@ -87,7 +85,7 @@ function BorrowModal(props: Props) {
|
||||
result = await repay({
|
||||
accountId: account.id,
|
||||
coin: BNCoin.fromDenomAndBigNumber(asset.denom, amount),
|
||||
accountBalance: percentage === 100,
|
||||
accountBalance: max.isEqualTo(amount),
|
||||
lends,
|
||||
})
|
||||
} else {
|
||||
@ -110,16 +108,6 @@ function BorrowModal(props: Props) {
|
||||
useStore.setState({ borrowModal: null })
|
||||
}
|
||||
|
||||
const liquidityAmountString = formatValue(modal.marketData?.liquidity?.amount.toString() || 0, {
|
||||
abbreviated: true,
|
||||
decimals: 6,
|
||||
})
|
||||
|
||||
const liquidityValueString = formatValue(modal.marketData?.liquidity?.value.toString() || 0, {
|
||||
abbreviated: true,
|
||||
decimals: 6,
|
||||
})
|
||||
|
||||
const handleChange = useCallback(
|
||||
(newAmount: BigNumber) => {
|
||||
const coin = BNCoin.fromDenomAndBigNumber(asset.denom, newAmount)
|
||||
|
Loading…
Reference in New Issue
Block a user