aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx/confirm-send-token.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-31 01:48:50 +0800
committerDan <danjm.com@gmail.com>2017-11-07 03:27:57 +0800
commit67bdfe87e31e695f8c4beab1659a3a4b764ccf24 (patch)
treebe7beef3beecccf6a4060b7f26e0d7ad5b0438b0 /ui/app/components/pending-tx/confirm-send-token.js
parent9f70762434deb1c973665a76623838289e655f22 (diff)
downloadtangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar.gz
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar.bz2
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar.lz
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar.xz
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.tar.zst
tangerine-wallet-browser-67bdfe87e31e695f8c4beab1659a3a4b764ccf24.zip
Token balance in send state; validating sufficient tokens, validation updates on 'from' switching.
Diffstat (limited to 'ui/app/components/pending-tx/confirm-send-token.js')
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index 3b8ae7f7f..f14da38ef 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -15,6 +15,9 @@ const {
multiplyCurrencies,
addCurrencies,
} = require('../../conversion-util')
+const {
+ calcTokenAmount,
+} = require('../../token-util')
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
@@ -73,8 +76,7 @@ ConfirmSendToken.prototype.getAmount = function () {
const { params = [] } = tokenData
const { value } = params[1] || {}
const { decimals } = token
- const multiplier = Math.pow(10, Number(decimals || 0))
- const sendTokenAmount = Number(value / multiplier)
+ const sendTokenAmount = calcTokenAmount(value, decimals)
return {
fiat: tokenExchangeRate