Attempt to mitigate loading all packs on load

- resolve type warnings
- remove unused RegEx
This commit is contained in:
Xevion
2023-02-16 14:35:54 -06:00
parent 9c5627935a
commit b37af0c105
3 changed files with 3 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ const Home: NextPage = () => {
const filtered = useMemo(() => {
const start = new Date();
const results = icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
const results = debouncedQuery.length == 0 ? [] : icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
const end = new Date();
// const results = fuse.search(query, {limit: maximumResults});
@@ -33,7 +33,7 @@ const Home: NextPage = () => {
}, [debouncedQuery]);
const catalog = useMemo(() => {
return <IconCatalog icons={debouncedQuery.length === 0 ? [] : filtered.map(i => i).slice(0, 100)}/>;
return <IconCatalog icons={filtered.map(i => i).slice(0, 100)}/>;
}, [filtered]);
return (