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 8, 2024
1 parent 8d4ad97 commit d14b34b
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 d14b34b

Please sign in to comment.