Skip to content

Commit

Permalink
return sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Sep 16, 2024
1 parent 2827294 commit f368c1c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,21 @@ const TokenList = (props: Props) => {
const queryLC = query.toLowerCase();

const symbolMatch = token.symbol?.toLowerCase().includes(queryLC);
if (symbolMatch) return true;

const displayNameMatch = getDisplayName(token, chain)
.toLowerCase()
.includes(queryLC);
if (displayNameMatch) return true;

const tokenAddress = isWrappedToken(token, chain)
? getTokenBridgeWrappedTokenAddressSync(token, chain)?.toString()
: token.tokenId?.address;

const tokenAddressMatch = tokenAddress?.toLowerCase().includes(queryLC);
if (tokenAddressMatch) return true;

return Boolean(symbolMatch || displayNameMatch || tokenAddressMatch);
return false;
}}
renderFn={(token: TokenConfig) => {
const balance = balances?.[token.key]?.balance;
Expand Down

0 comments on commit f368c1c

Please sign in to comment.