Skip to content

Commit

Permalink
chore: trim searchQuery before checking for symbol match
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Oct 9, 2024
1 parent bf57b5c commit 2309fa5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ export function AssetPickerModal({

// Default filter predicate for whether a token should be included in displayed list
const shouldAddToken = (symbol: string, address?: string | null) => {
const trimmedSearchQuery = searchQuery.trim();
return (
symbol?.toLowerCase().includes(searchQuery.toLowerCase()) &&
(!trimmedSearchQuery ||
symbol?.toLowerCase().includes(trimmedSearchQuery.toLowerCase())) &&
!filteredTokensAddresses.has(address?.toLowerCase())
);
};
Expand Down

0 comments on commit 2309fa5

Please sign in to comment.