diff options
author | Dan <danjm.com@gmail.com> | 2018-04-27 00:38:38 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-04-27 00:38:38 +0800 |
commit | 8ff7806f1b471a90fa3f45ebc10f0f4452ade541 (patch) | |
tree | fe4c9483f6b7ffadda35f304f15bbf3a02974910 /ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js | |
parent | 02a6d2089ede7d3faf4990c40b85b9f773f82c64 (diff) | |
download | tangerine-wallet-browser-8ff7806f1b471a90fa3f45ebc10f0f4452ade541.tar.gz tangerine-wallet-browser-8ff7806f1b471a90fa3f45ebc10f0f4452ade541.tar.zst tangerine-wallet-browser-8ff7806f1b471a90fa3f45ebc10f0f4452ade541.zip |
Core of the refactor complete
Diffstat (limited to 'ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js')
-rw-r--r-- | ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js index 5b01b4594..418b98c18 100644 --- a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js +++ b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js @@ -1,4 +1,11 @@ const { isValidAddress } = require('../../../../util') +const { + conversionGreaterThan, +} = require('../../../../conversion-util') +const { + isBalanceSufficient, + isTokenBalanceSufficient, +} = require('../../send.utils') function getAmountErrorObject ({ amount, @@ -10,6 +17,14 @@ function getAmountErrorObject ({ gasTotal, tokenBalance, }) { + console.log(`#& getAmountErrorObject amount`, amount); + console.log(`#& getAmountErrorObject balance`, balance); + console.log(`#& getAmountErrorObject amountConversionRate`, amountConversionRate); + console.log(`#& getAmountErrorObject conversionRate`, conversionRate); + console.log(`#& getAmountErrorObject primaryCurrency`, primaryCurrency); + console.log(`#& getAmountErrorObject selectedToken`, selectedToken); + console.log(`#& getAmountErrorObject gasTotal`, gasTotal); + console.log(`#& getAmountErrorObject tokenBalance`, tokenBalance); let insufficientFunds = false if (gasTotal && conversionRate) { insufficientFunds = !isBalanceSufficient({ @@ -40,11 +55,11 @@ function getAmountErrorObject ({ let amountError = null if (insufficientFunds) { - amountError = this.context.t('insufficientFunds') - } else if (insufficientTokens) { - amountError = this.context.t('insufficientTokens') + amountError = 'insufficientFunds' + } else if (inSufficientTokens) { + amountError = 'insufficientTokens' } else if (amountLessThanZero) { - amountError = this.context.t('negativeETH') + amountError = 'negativeETH' } return { amount: amountError } |