Skip to content

NVR with realtime local object detection for IP cameras

preserve search query in overlay state hook (#15334)

Josh Hawkinsa7294085994f
diff --git a/web/src/hooks/use-overlay-state.tsx b/web/src/hooks/use-overlay-state.tsx
index 75d738e61b..841585b25d 100644
--- a/web/src/hooks/use-overlay-state.tsx
+++ b/web/src/hooks/use-overlay-state.tsx
@@ -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