Add resiliency to confirm-send-token

feature/default_network_editable
Chi Kei Chan 7 years ago
parent d6f1f2bcca
commit 5eb3cf43bf
  1. 10
      ui/app/components/pending-tx/confirm-send-token.js

@ -85,7 +85,9 @@ ConfirmSendToken.prototype.getAmount = function () {
fiat: tokenExchangeRate fiat: tokenExchangeRate
? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2) ? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2)
: null, : 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: fiatAmount, token: tokenAmount } = this.getAmount()
const { fiat: fiatGas, token: tokenGas } = this.getGasFee() const { fiat: fiatGas, token: tokenGas } = this.getGasFee()
const tokenTotal = addCurrencies(tokenAmount, tokenGas || '0')
return fiatAmount && fiatGas return fiatAmount && fiatGas
? ( ? (
h('section.flex-row.flex-center.confirm-screen-total-box ', [ 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-section-column', [
h('div.confirm-screen-row-info', `${fiatAmount + fiatGas} ${currentCurrency}`), 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('span.confirm-screen-label.confirm-screen-section-column', [ 'To' ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', toName), h('div.confirm-screen-row-info', toName),

Loading…
Cancel
Save