diff --git a/components/SupportedNetworks/Networks.tsx b/components/SupportedNetworks/Networks.tsx index 9478486a..f6959c0c 100644 --- a/components/SupportedNetworks/Networks.tsx +++ b/components/SupportedNetworks/Networks.tsx @@ -380,7 +380,7 @@ const SupportedNetworks: React.FC = () => { - new Fuse(sortedByChainId, { - keys: [ - { - name: 'name', - weight: 0.99 - }, - { - name: 'chainId', - weight: 0.5 - } - ], - distance: 500, - threshold: 0.3, - findAllMatches: true - }), - [sortedByChainId] - ) return useMemo(() => { - if (query.length === 0) { - return sortedByChainId - } + if (query.length === 0) return sortedByChainId - return fuse.search(query).map(result => result.item) - }, [fuse, sortedByChainId, query]) + const lowercaseQuery = query.toLowerCase() + return sortedByChainId.filter( + network => + network.name.toLowerCase().includes(lowercaseQuery) || + network.chainId.toString().includes(lowercaseQuery) || + network.smartAccounts?.some(account => + account.address?.toLowerCase().includes(lowercaseQuery) + ) + ) + }, [sortedByChainId, query]) }