diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 07:18:25 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 07:18:25 +0800 |
commit | 5eb3cf43bfab3728dde151bc84439993b1a93184 (patch) | |
tree | 351f909d4ab9a14aa856941f0de518fb98dc5f6a | |
parent | d6f1f2bcca5609f9715ea477ff9ad832457f6b18 (diff) | |
download | tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.gz tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.bz2 tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.lz tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.xz tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.tar.zst tangerine-wallet-browser-5eb3cf43bfab3728dde151bc84439993b1a93184.zip |
Add resiliency to confirm-send-token
-rw-r--r-- | ui/app/components/pending-tx/confirm-send-token.js | 10 |
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), |