mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: reset search results on navigation
This commit is contained in:
committed by
Abdullah Atta
parent
26d08615a7
commit
8311db0572
@@ -31,9 +31,9 @@ export function useSearch<T>(
|
||||
const [filteredItems, setFilteredItems] = useState<VirtualizedGrouping<T>>();
|
||||
|
||||
useEffect(() => {
|
||||
if (searchType !== type) return;
|
||||
(async function () {
|
||||
if (!query || !isSearching) return setFilteredItems(undefined);
|
||||
if (searchType !== type) return;
|
||||
setFilteredItems(await lookup(query));
|
||||
})();
|
||||
}, [isSearching, query, searchType, type, ...deps]);
|
||||
|
||||
Reference in New Issue
Block a user