Skip to content

Commit

Permalink
preserve search query in overlay state hook (#15334)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 authored Dec 4, 2024
1 parent 4dddc53 commit a729408
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/src/hooks/use-overlay-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export function useOverlayState<S>(
(value: S, replace: boolean = false) => {
const newLocationState = { ...currentLocationState };
newLocationState[key] = value;
navigate(location.pathname, { state: newLocationState, replace });
navigate(location.pathname + location.search, {
state: newLocationState,
replace,
});
},
// we know that these deps are correct
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit a729408

Please sign in to comment.