Skip to content

Commit

Permalink
Fix isZero is undefined (#2625)
Browse files Browse the repository at this point in the history
* Fix isZero is undefined

* Update app/components/UI/Tokens/index.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

* add optional chaining

Co-authored-by: Esteban Miño <efmino@uc.cl>
  • Loading branch information
rickycodes and estebanmino authored May 6, 2021
1 parent 843fd0d commit 95d3845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/UI/Tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class Tokens extends PureComponent {
const hasTokensBalance =
hasTokens &&
tokens.some(
token => !token.isETH && tokenBalances[token.address] && !tokenBalances[token.address].isZero()
token => !token.isETH && tokenBalances[token.address] && !tokenBalances[token.address]?.isZero?.()
);

return (
Expand All @@ -266,7 +266,7 @@ class Tokens extends PureComponent {
const tokensToDisplay = hideZeroBalanceTokens
? tokens.filter(token => {
const { address, symbol } = token;
return (tokenBalances[address] && !tokenBalances[address].isZero()) || symbol === 'ETH';
return (tokenBalances[address] && !tokenBalances[address]?.isZero?.()) || symbol === 'ETH';
// eslint-disable-next-line no-mixed-spaces-and-tabs
})
: tokens;
Expand Down

0 comments on commit 95d3845

Please sign in to comment.