aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx/confirm-send-token.js
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-21 07:18:25 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-21 07:18:25 +0800
commit5eb3cf43bfab3728dde151bc84439993b1a93184 (patch)
tree351f909d4ab9a14aa856941f0de518fb98dc5f6a /ui/app/components/pending-tx/confirm-send-token.js
parentd6f1f2bcca5609f9715ea477ff9ad832457f6b18 (diff)
downloadtangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.gz
tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.zst
tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.zip
Add resiliency to confirm-send-token
Diffstat (limited to 'ui/app/components/pending-tx/confirm-send-token.js')
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index 6fb4ddf70..a4c3d16e3 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -85,7 +85,9 @@ ConfirmSendToken.prototype.getAmount = function () {
fiat: tokenExchangeRate
? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2)
: null,
- token: +sendTokenAmount.toFixed(decimals),
+ token: typeof value === 'undefined'
+ ? 'Unknown'
+ : +sendTokenAmount.toFixed(decimals),
}
}
@@ -213,8 +215,6 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
const { fiat: fiatAmount, token: tokenAmount } = this.getAmount()
const { fiat: fiatGas, token: tokenGas } = this.getGasFee()
- const tokenTotal = addCurrencies(tokenAmount, tokenGas || '0')
-
return fiatAmount && fiatGas
? (
h('section.flex-row.flex-center.confirm-screen-total-box ', [
@@ -225,7 +225,7 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', `${fiatAmount + fiatGas} ${currentCurrency}`),
- h('div.confirm-screen-row-detail', `${tokenTotal} ${symbol}`),
+ h('div.confirm-screen-row-detail', `${addCurrencies(tokenAmount, tokenGas || '0')} ${symbol}`),
]),
])
)
@@ -321,7 +321,7 @@ ConfirmSendToken.prototype.render = function () {
]),
]),
- h('section.flex-row.flex-center.confirm-screen-row', [
+ toAddress && h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ 'To' ]),
h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', toName),