diff --git a/web/hooks/use-sort-and-query-params.tsx b/web/hooks/use-sort-and-query-params.tsx index fb5bf29b..ae226e87 100644 --- a/web/hooks/use-sort-and-query-params.tsx +++ b/web/hooks/use-sort-and-query-params.tsx @@ -104,7 +104,9 @@ export function useQueryAndSortParams(options?: { const pushQuery = useMemo( () => debounce((query: string | undefined) => { - router.replace({ query: { ...router.query, q: query } }, undefined, { + const queryObj = { ...router.query, q: query || undefined } + if (!query) delete queryObj.q + router.replace({ query: queryObj }, undefined, { shallow: true, }) }, 100),