diff --git a/src/Common/hooks/useFilters.tsx b/src/Common/hooks/useFilters.tsx index 5781eaca54f..bc46f69aee5 100644 --- a/src/Common/hooks/useFilters.tsx +++ b/src/Common/hooks/useFilters.tsx @@ -27,7 +27,9 @@ export default function useFilters({ limit = 14 }: { limit?: number }) { const updateQuery = (filter: FilterState) => { filter = hasPagination ? { page: 1, limit, ...filter } : filter; - setQueryParams(Object.assign({}, qParams, filter), { replace: true }); + const query = Object.assign({}, qParams, filter); + setQueryParams(query, { replace: true }); + updateFiltersCache(query); }; const updatePage = (page: number) => { if (!hasPagination) return; @@ -38,8 +40,6 @@ export default function useFilters({ limit = 14 }: { limit?: number }) { }; const removeFilter = (param: string) => removeFilters([param]); - useEffect(() => updateFiltersCache(qParams), [qParams]); - useEffect(() => { const cache = getFiltersCache(); const qParamKeys = Object.keys(qParams);