Skip to content

Commit

Permalink
#Change Vaults页面输入框删除0再输入0之后单个存入提取按钮可以用的BUG && 全部存入按钮限制改为余额不能大于最大限制,大…
Browse files Browse the repository at this point in the history
…于的话禁用
  • Loading branch information
LancelotM committed Oct 18, 2020
1 parent daad474 commit 2537714
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/features/vault/sections/SectionPools.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ export default function SectionPools() {
}
}, [address, web3, fetchBalances, fetchPoolBalances]);

const isMoreDepostLimit = (inputValueNum,depostLimit) => {
if(isEmpty(inputValueNum) || depostLimit==0 || inputValueNum<depostLimit){
return false;
const isMoreDepostLimit = (value,depostLimit) => {
if(isEmpty(value) || depostLimit==0 || value < depostLimit){
return false
}
return true;
}
Expand Down Expand Up @@ -440,7 +440,7 @@ export default function SectionPools() {
round
onFocus={(event) => event.stopPropagation()}
disabled={
!Boolean(depositedBalance[index]) || fetchDepositPending[index] || (new BigNumber(depositedBalance[index]).toNumber() > balanceSingle.toNumber() || isMoreDepostLimit(new BigNumber(depositedBalance[index]).toNumber(),pool.depostLimit))
!Boolean(depositedBalance[index]) || !Boolean(depositedBalance[index]!=0) || fetchDepositPending[index] || (new BigNumber(depositedBalance[index]).toNumber() > balanceSingle.toNumber() || isMoreDepostLimit(new BigNumber(depositedBalance[index]).toNumber(),pool.depostLimit) )
}
onClick={onDeposit.bind(this, pool, index, false, balanceSingle)}
>{t('Vault-DepositButton')}
Expand All @@ -458,7 +458,7 @@ export default function SectionPools() {
round
onFocus={(event) => event.stopPropagation()}
disabled={
fetchDepositPending[index] || (new BigNumber(depositedBalance[index]).toNumber() > balanceSingle.toNumber() || isMoreDepostLimit(new BigNumber(depositedBalance[index]).toNumber(),pool.depostLimit))
fetchDepositPending[index] || (new BigNumber(depositedBalance[index]).toNumber() > balanceSingle.toNumber() || isMoreDepostLimit(balanceSingle.toNumber(),pool.depostLimit) )
}
onClick={onDeposit.bind(this, pool, index, true, balanceSingle)}
>{t('Vault-DepositButtonAll')}
Expand Down Expand Up @@ -502,7 +502,7 @@ export default function SectionPools() {
round
type="button"
color="primary"
disabled={fetchWithdrawPending[index] || !Boolean(withdrawAmount[index])}
disabled={fetchWithdrawPending[index] || !Boolean(withdrawAmount[index]) || !Boolean(withdrawAmount[index]!=0)}
onClick={onWithdraw.bind(this, pool, index, false, singleDepositedBalance)}
>
{fetchWithdrawPending[index] ? `${t('Vault-WithdrawING')}`: `${t('Vault-WithdrawButton')}`}
Expand Down

0 comments on commit 2537714

Please sign in to comment.