From 89573533b8da75138bddffbadbaeff6f9eb68001 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 20 Oct 2017 11:48:01 -0230 Subject: Fixes add token search. --- ui/app/add-token.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/add-token.js b/ui/app/add-token.js index 90edc8de1..3ef9b6814 100644 --- a/ui/app/add-token.js +++ b/ui/app/add-token.js @@ -105,6 +105,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() -- cgit v1.2.3 From b25c73a866140e362ea27d455101d07ccf1a56e6 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 20 Oct 2017 12:01:34 -0230 Subject: Only show erc20 tokens in add token search. --- ui/app/add-token.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/app/add-token.js b/ui/app/add-token.js index 3ef9b6814..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, -- cgit v1.2.3