diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-14 10:57:33 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-14 10:57:33 +0800 |
commit | d722c1045f70954cb1a97de52cae5084a6f14815 (patch) | |
tree | 45307f0cf792991d2e0284f9479c9aae49ed13e8 /ui/app/components | |
parent | 6bd71d69378c74de8748bdfb5476ec082077676c (diff) | |
download | tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar.gz tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar.bz2 tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar.lz tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar.xz tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.tar.zst tangerine-wallet-browser-d722c1045f70954cb1a97de52cae5084a6f14815.zip |
Update yarn.lock; Fix tx-list-item overflow; Fix gas exchange rate
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pending-tx.js | 72 | ||||
-rw-r--r-- | ui/app/components/send-token/index.js | 2 |
2 files changed, 50 insertions, 24 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 99769e4e6..6eb2fb2b2 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -48,7 +48,7 @@ function mapDispatchToProps (dispatch) { return { setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('USD')), backToAccountDetail: address => dispatch(actions.backToAccountDetail(address)), - cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })) + cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })), } } @@ -77,28 +77,55 @@ PendingTx.prototype.getTotal = function () { const amountBn = name === '_value' ? value : txParams.value - - const USD = conversionUtil(amountBn, { - fromNumericBase: 'hex', - toNumericBase: 'dec', - fromCurrency: 'ETH', - toCurrency: 'USD', - numberOfDecimals: 2, - conversionRate, - }) - const ETH = conversionUtil(amountBn, { - fromNumericBase: 'hex', - toNumericBase: 'dec', - fromCurrency: 'ETH', - toCurrency: 'ETH', - conversionRate, - numberOfDecimals: 6, - }) - return { - USD, - ETH, + if (name === '_value') { + const token = util.getContractAtAddress(txParams.to) + token.symbol().then(symbol => console.log({symbol})) + console.log({txParams, txMeta, decodedData, token}) + const USD = conversionUtil(amountBn, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'USD', + numberOfDecimals: 2, + conversionRate, + }) + const ETH = conversionUtil(amountBn, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'ETH', + conversionRate, + numberOfDecimals: 6, + }) + return { + USD, + ETH, + } + } else { + const USD = conversionUtil(amountBn, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'USD', + numberOfDecimals: 2, + conversionRate, + }) + const ETH = conversionUtil(amountBn, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'ETH', + conversionRate, + numberOfDecimals: 6, + }) + + return { + USD, + ETH, + } } + } PendingTx.prototype.getGasFee = function () { @@ -400,12 +427,11 @@ PendingTx.prototype.getFormEl = function () { // After a customizable state value has been updated, PendingTx.prototype.gatherTxMeta = function () { - log.debug(`pending-tx gatherTxMeta`) const props = this.props const state = this.state const txData = clone(state.txData) || clone(props.txData) - log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`) + // log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`) return txData } diff --git a/ui/app/components/send-token/index.js b/ui/app/components/send-token/index.js index 851d463eb..a3332ca9e 100644 --- a/ui/app/components/send-token/index.js +++ b/ui/app/components/send-token/index.js @@ -292,7 +292,7 @@ SendTokenScreen.prototype.renderGasInput = function () { conversionRate, tokenExchangeRate, gasPrice, - currentCurrency: selectedCurrency, + activeCurrency: selectedCurrency, gas: gasLimit, blockGasLimit: currentBlockGasLimit, }), |