Skip to content

Commit

Permalink
fix: filter update with view props
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Aug 5, 2024
1 parent ccf8fa9 commit 55e4388
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useUrlFilterParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const useUrlFilterParams = ({ preset }: { preset?: FilterById }) => {
const pushStateToRouter = useCallback(
(queryState: Partial<QueryState>) => {
const newUrl = router.asPath.split('?')[0];
const urlParams = buildURLSearchParams({ groupBy, ...queryState });
const urlParams = buildURLSearchParams({ groupBy, view, ...queryState });

const isEmptySearch = !Array.from(urlParams.keys()).length;

Expand All @@ -236,7 +236,7 @@ export const useUrlFilterParams = ({ preset }: { preset?: FilterById }) => {

router.push(!isEmptySearch ? `${newUrl}?${urlParams}` : newUrl);
},
[groupBy, router],
[groupBy, view, router],
);

const pushStateProvider = useMemo(() => {
Expand Down

0 comments on commit 55e4388

Please sign in to comment.