perform search on first navigate

Signed-off-by: John Philip <jphilip@spotify.com>
This commit is contained in:
John Philip
2026-02-23 16:30:33 -05:00
parent 3856774252
commit 5cefb88bb2
2 changed files with 2 additions and 5 deletions
@@ -138,14 +138,13 @@ const useSearchContextValue = (
const result = useAsync(async (): Promise<SearchResultSet> => {
if (isFirstEmptyMount.current) {
isFirstEmptyMount.current = false;
if (!term && !types.length && !Object.keys(filters).length) {
return {
results: [],
numberOfResults: 0,
};
}
isFirstEmptyMount.current = false;
}
// Here we cancel the previous request before making a new one
@@ -59,9 +59,7 @@ export const UrlUpdater = () => {
setPageCursor(query.pageCursor as string);
}
if (query.types) {
setTypes(query.types as string[]);
}
setTypes(query.types ? (query.types as string[]) : []);
}, [prevQueryParams, location, setTerm, setTypes, setPageCursor, setFilters]);
useEffect(() => {