diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-04-18 04:36:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 04:36:21 +0800 |
commit | 6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8 (patch) | |
tree | 096c6a8f7e12c5ece8bb64af1466bb2d94b6e5d3 /ui/app/components/token-cell.js | |
parent | f15b81089e86dc095983faeba4a97209ddd670ce (diff) | |
parent | 7b70804aa0d74120098a4bcb2c375d29080e8368 (diff) | |
download | tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar.gz tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar.bz2 tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar.lz tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar.xz tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.tar.zst tangerine-wallet-browser-6ee57dcad70057b1f71b9abe53d9d4965cbbe3e8.zip |
Merge branch 'master' into i3580-InternationalizeCurrency
Diffstat (limited to 'ui/app/components/token-cell.js')
-rw-r--r-- | ui/app/components/token-cell.js | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js index 0332fde88..c84117d84 100644 --- a/ui/app/components/token-cell.js +++ b/ui/app/components/token-cell.js @@ -16,7 +16,7 @@ function mapStateToProps (state) { currentCurrency: state.metamask.currentCurrency, selectedTokenAddress: state.metamask.selectedTokenAddress, userAddress: selectors.getSelectedAddress(state), - tokenExchangeRates: state.metamask.tokenExchangeRates, + contractExchangeRates: state.metamask.contractExchangeRates, conversionRate: state.metamask.conversionRate, sidebarOpen: state.appState.sidebarOpen, } @@ -25,7 +25,6 @@ function mapStateToProps (state) { function mapDispatchToProps (dispatch) { return { setSelectedToken: address => dispatch(actions.setSelectedToken(address)), - updateTokenExchangeRate: token => dispatch(actions.updateTokenExchangeRate(token)), hideSidebar: () => dispatch(actions.hideSidebar()), } } @@ -41,15 +40,6 @@ function TokenCell () { } } -TokenCell.prototype.componentWillMount = function () { - const { - updateTokenExchangeRate, - symbol, - } = this.props - - updateTokenExchangeRate(symbol) -} - TokenCell.prototype.render = function () { const { tokenMenuOpen } = this.state const props = this.props @@ -60,7 +50,7 @@ TokenCell.prototype.render = function () { network, setSelectedToken, selectedTokenAddress, - tokenExchangeRates, + contractExchangeRates, conversionRate, hideSidebar, sidebarOpen, @@ -68,15 +58,13 @@ TokenCell.prototype.render = function () { // userAddress, } = props - const pair = `${symbol.toLowerCase()}_eth` - let currentTokenToFiatRate let currentTokenInFiat let formattedFiat = '' - if (tokenExchangeRates[pair]) { + if (contractExchangeRates[address]) { currentTokenToFiatRate = multiplyCurrencies( - tokenExchangeRates[pair].rate, + contractExchangeRates[address], conversionRate ) currentTokenInFiat = conversionUtil(string, { |