diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-06-20 23:58:25 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-06-20 23:58:25 +0800 |
commit | 027394b2058b31daa399c582c82f0c0b01571144 (patch) | |
tree | 16eb21f475cc0abd755ab6d5e69dfae7d85d9d65 | |
parent | 41d992cca960c9f1b17bbd4bac9793902a7d1716 (diff) | |
download | tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar.gz tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar.bz2 tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar.lz tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar.xz tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.tar.zst tangerine-wallet-browser-027394b2058b31daa399c582c82f0c0b01571144.zip |
Reduce token list clutter by only showing held tokens
We could change this when we allow hiding/removing tokens, but for now, this is a simple and pleasant solution.
-rw-r--r-- | ui/app/components/token-list.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 100e596ed..bc41c5270 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -20,7 +20,7 @@ module.exports = TokenList inherits(TokenList, Component) function TokenList () { this.state = { - tokens: null, + tokens: [], isLoading: true, network: null, } @@ -150,12 +150,9 @@ TokenList.prototype.componentWillUpdate = function (nextProps) { } } -TokenList.prototype.updateBalances = function (tokenData) { - const desired = this.props.tokens.map(token => token.address) - const heldTokens = tokenData.filter(token => { - const held = token.balance !== '0' && token.string !== '0.000' - const preferred = desired.includes(normalizeAddress(token.address)) - return held || preferred +TokenList.prototype.updateBalances = function (tokens) { + const heldTokens = tokens.filter(token => { + return token.balance !== '0' && token.string !== '0.000' }) this.setState({ tokens: heldTokens, isLoading: false }) } |