aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-content/send-amount-row/send-amount-row.utils.js
diff options
context:
space:
mode:
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.js23
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 }