Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
refactor: Use isNotErc20TokenAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
ltfschoen committed Apr 12, 2019
1 parent 0197108 commit b94d4a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/fether-react/src/utils/withTokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;

Expand Down Expand Up @@ -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)
)
};
}),
Expand Down

0 comments on commit b94d4a2

Please sign in to comment.