Skip to content

Commit

Permalink
Safeguard router
Browse files Browse the repository at this point in the history
  • Loading branch information
alianza committed Jun 1, 2024
1 parent d3081cc commit 6917ef9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pages/combos/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function CombosPage() {
}, [filters]);

useEffect(() => {
if (!router.isReady) return;
setFilters({ ...defaultFilters, ...pick(parseUrlQueryParams(router.query), Object.keys(defaultFilters)) }); // set filters from url params
router.push({ query: { ...filters, ...router.query } }, undefined, { shallow: true }); // set new url params with filters including current params E.g. page number
}, [router.isReady]);
Expand Down

0 comments on commit 6917ef9

Please sign in to comment.