aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-21 06:35:04 +0800
committerGitHub <noreply@github.com>2017-10-21 06:35:04 +0800
commit511339a969cdf0301b7f409498cd820262e1daa5 (patch)
treef1f889a24de56c6d42b530fa60a430bccc7cd647 /ui
parent92d922c937c69a84fe66399d11a50902427aa2f6 (diff)
parentb25c73a866140e362ea27d455101d07ccf1a56e6 (diff)
downloadtangerine-wallet-browser-511339a969cdf0301b7f409498cd820262e1daa5.tar.gz
tangerine-wallet-browser-511339a969cdf0301b7f409498cd820262e1daa5.tar.zst
tangerine-wallet-browser-511339a969cdf0301b7f409498cd820262e1daa5.zip
Merge pull request #2413 from danjm/NewUI-flat-fix-addtoken-search
[NewUI-flat] Fixes add token search.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/add-token.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/app/add-token.js b/ui/app/add-token.js
index 90edc8de1..e313babf3 100644
--- a/ui/app/add-token.js
+++ b/ui/app/add-token.js
@@ -7,7 +7,9 @@ const Fuse = require('fuse.js')
const contractMap = require('eth-contract-metadata')
const TokenBalance = require('./components/token-balance')
const Identicon = require('./components/identicon')
-const contractList = Object.entries(contractMap).map(([ _, tokenData]) => tokenData)
+const contractList = Object.entries(contractMap)
+ .map(([ _, tokenData]) => tokenData)
+ .filter(tokenData => Boolean(tokenData.erc20))
const fuse = new Fuse(contractList, {
shouldSort: true,
threshold: 0.45,
@@ -105,6 +107,7 @@ AddTokenScreen.prototype.tokenAddressDidChange = function (e) {
}
AddTokenScreen.prototype.checkExistingAddresses = function (address) {
+ if (!address) return false
const tokensList = this.props.tokens
const matchesAddress = existingToken => {
return existingToken.address.toLowerCase() === address.toLowerCase()