aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-08-16 05:34:57 +0800
committerEsteban MIno <efmino@uc.cl>2018-08-16 05:34:57 +0800
commitb766104c8d8fc4d4b1c5660af54b791243836f30 (patch)
tree24d6ae70a7a1790fb663cc1813d84bce96291d1b /ui/app/components
parenta4b6b2357a2eee7a4286a8490b8d31aac487120d (diff)
downloadtangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar.gz
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar.bz2
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar.lz
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar.xz
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.tar.zst
tangerine-wallet-browser-b766104c8d8fc4d4b1c5660af54b791243836f30.zip
add suggested tokens objects in metamask state
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/balance-component.js5
-rw-r--r--ui/app/components/token-list.js4
2 files changed, 4 insertions, 5 deletions
diff --git a/ui/app/components/balance-component.js b/ui/app/components/balance-component.js
index 5e2919fca..1a55a1f5b 100644
--- a/ui/app/components/balance-component.js
+++ b/ui/app/components/balance-component.js
@@ -22,6 +22,7 @@ function mapStateToProps (state) {
network,
conversionRate: state.metamask.conversionRate,
currentCurrency: state.metamask.currentCurrency,
+ objects: state.metamask.objects,
}
}
@@ -32,9 +33,9 @@ function BalanceComponent () {
BalanceComponent.prototype.render = function () {
const props = this.props
- const { token, network } = props
+ const { token, network, objects } = props
let imageUrl
- if (token) imageUrl = token.imageUrl
+ if (token) imageUrl = objects[token.address]
return h('div.balance-container', {}, [
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js
index a59c2e4e0..0f88a7703 100644
--- a/ui/app/components/token-list.js
+++ b/ui/app/components/token-list.js
@@ -11,13 +11,11 @@ const log = require('loglevel')
function mapStateToProps (state) {
// In order to get `imageUrl` from token added with `eth_watchToken`
// TODO do this with cache memory for browsers, add support for image object, var names
- const tokenImagesHashes = {}
- state.metamask.tokens.forEach((token) => { tokenImagesHashes[token.address] = token.imageUrl })
return {
network: state.metamask.network,
tokens: state.metamask.tokens,
userAddress: selectors.getSelectedAddress(state),
- tokenImagesHashes: tokenImagesHashes,
+ tokenImagesHashes: state.metamask.objects,
}
}