aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-list.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-08-17 04:38:21 +0800
committerGitHub <noreply@github.com>2017-08-17 04:38:21 +0800
commit0477e08a6d38cd749ea5649e7dbd2b1e56207a2e (patch)
tree485d7996dc5412c45589c352c86ad834d02dd523 /ui/app/components/token-list.js
parent60fdbd67af8b8b931c068d35ce81d11e21da2cef (diff)
parent9fbdeab3deeb12999b14acfb9f8d6dd28b979c10 (diff)
downloadtangerine-wallet-browser-0477e08a6d38cd749ea5649e7dbd2b1e56207a2e.tar.gz
tangerine-wallet-browser-0477e08a6d38cd749ea5649e7dbd2b1e56207a2e.tar.zst
tangerine-wallet-browser-0477e08a6d38cd749ea5649e7dbd2b1e56207a2e.zip
Merge pull request #1928 from MetaMask/RemoveDefaultTokens
Remove default tokens
Diffstat (limited to 'ui/app/components/token-list.js')
-rw-r--r--ui/app/components/token-list.js45
1 files changed, 19 insertions, 26 deletions
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js
index 5ea31ae8d..2346568bc 100644
--- a/ui/app/components/token-list.js
+++ b/ui/app/components/token-list.js
@@ -3,17 +3,6 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const TokenTracker = require('eth-token-tracker')
const TokenCell = require('./token-cell.js')
-const normalizeAddress = require('eth-sig-util').normalize
-
-const defaultTokens = []
-const contracts = require('eth-contract-metadata')
-for (const address in contracts) {
- const contract = contracts[address]
- if (contract.erc20) {
- contract.address = address
- defaultTokens.push(contract)
- }
-}
module.exports = TokenList
@@ -38,7 +27,24 @@ TokenList.prototype.render = function () {
if (error) {
log.error(error)
- return this.message('There was a problem loading your token balances.')
+ return h('.hotFix', {
+ style: {
+ padding: '80px',
+ },
+ }, [
+ 'We had trouble loading your token balances. You can view them ',
+ h('span.hotFix', {
+ style: {
+ color: 'rgba(247, 134, 28, 1)',
+ cursor: 'pointer',
+ },
+ onClick: () => {
+ global.platform.openWindow({
+ url: `https://ethplorer.io/address/${userAddress}`,
+ })
+ },
+ }, 'here'),
+ ])
}
const tokenViews = tokens.map((tokenData) => {
@@ -153,7 +159,7 @@ TokenList.prototype.createFreshTokenTracker = function () {
this.tracker = new TokenTracker({
userAddress,
provider: global.ethereumProvider,
- tokens: uniqueMergeTokens(defaultTokens, this.props.tokens),
+ tokens: this.props.tokens,
pollingInterval: 8000,
})
@@ -199,16 +205,3 @@ TokenList.prototype.componentWillUnmount = function () {
this.tracker.stop()
}
-function uniqueMergeTokens (tokensA, tokensB) {
- const uniqueAddresses = []
- const result = []
- tokensA.concat(tokensB).forEach((token) => {
- const normal = normalizeAddress(token.address)
- if (!uniqueAddresses.includes(normal)) {
- uniqueAddresses.push(normal)
- result.push(token)
- }
- })
- return result
-}
-