don't clear url params if we're creating a new object mask

This commit is contained in:
Josh Hawkins 2025-02-15 06:57:20 -06:00
parent 7b3556e4ad
commit 6c6b4e30d5

View File

@ -38,6 +38,7 @@ import NotificationView from "@/views/settings/NotificationsSettingsView";
import SearchSettingsView from "@/views/settings/SearchSettingsView";
import UiSettingsView from "@/views/settings/UiSettingsView";
import { useSearchEffect } from "@/hooks/use-overlay-state";
import { useSearchParams } from "react-router-dom";
const allSettingsViews = [
"UI settings",
@ -58,6 +59,8 @@ export default function Settings() {
const { data: config } = useSWR<FrigateConfig>("config");
const [searchParams] = useSearchParams();
// available settings views
const settingsViews = useMemo(() => {
@ -124,7 +127,8 @@ export default function Settings() {
if (allSettingsViews.includes(page as SettingsType)) {
setPage(page as SettingsType);
}
return false;
// don't clear url params if we're creating a new object mask
return !searchParams.has("object_mask");
});
useSearchEffect("camera", (camera: string) => {
@ -132,7 +136,8 @@ export default function Settings() {
if (cameraNames.includes(camera)) {
setSelectedCamera(camera);
}
return false;
// don't clear url params if we're creating a new object mask
return !searchParams.has("object_mask");
});
useEffect(() => {