Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSchinzel committed Jul 18, 2024
1 parent 6de665c commit 45a91c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion suite-common/wallet-utils/src/accountUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ export const isAddressBasedNetwork = (networkType: NetworkType) => {
return !!exhaustiveCheck;
};

export const tokenMatchesSearch = (token: TokenInfo, search: string) => {
export const isTokenMatchesSearch = (token: TokenInfo, search: string) => {
return (
token.symbol?.toLowerCase().includes(search) ||
token.name?.toLowerCase().includes(search) ||
Expand Down
10 changes: 5 additions & 5 deletions suite-common/wallet-utils/src/transactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ export const simpleSearchTransactions = (

// Searching for an amount (without operator)
if (!Number.isNaN(search)) {
const foundTxsForNumber = transactions.flatMap(t => {
const targetAmounts = getTargetAmounts(t);
const foundTxsForNumber = transactions.flatMap(transaction => {
const targetAmounts = getTargetAmounts(transaction);
if (targetAmounts.filter(targetAmount => targetAmount.includes(search)).length === 0) {
return [];
}
Expand Down Expand Up @@ -921,13 +921,13 @@ export const simpleSearchTransactions = (
txsToSearch.push(...foundTxsForAddress);

// Find by token name, symbol or contract
const foundTxsForToken = transactions.flatMap(t => {
const hasMatchingToken = t.tokens.some(token => {
const foundTxsForToken = transactions.flatMap(transaction => {
const hasMatchingToken = transaction.tokens.some(token => {
return tokenMatchesSearch(token, search.toLowerCase());
});

if (hasMatchingToken) {
return t.txid;
return transaction.txid;
}

return [];
Expand Down

0 comments on commit 45a91c3

Please sign in to comment.