diff --git a/packages/fether-react/src/utils/withTokens.js b/packages/fether-react/src/utils/withTokens.js index fb4950170..d49235d4e 100644 --- a/packages/fether-react/src/utils/withTokens.js +++ b/packages/fether-react/src/utils/withTokens.js @@ -14,6 +14,7 @@ import classicIcon from '../assets/img/tokens/classic.svg'; import localForage$ from './localForage'; import LS_PREFIX from '../stores/utils/lsPrefix'; import withAccount from './withAccount'; +import { isNotErc20TokenAddress } from './chain'; const LS_KEY = `${LS_PREFIX}::tokens`; @@ -69,11 +70,12 @@ const withTokens = compose( // Also compute some related props related to tokens withProps(({ tokens }) => { const tokensArray = Object.values(tokens); + return { tokensArray, tokensArrayWithoutEth: tokensArray.filter( // Ethereum and Ethereum Classic are the only tokens without address, has 'ETH' or 'ETC' instead - ({ address }) => address !== 'ETH' && address !== 'ETC' + ({ address }) => !isNotErc20TokenAddress(address) ) }; }),