diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 7875cc3e0..b8ed05b7b 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -52,7 +52,10 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) { // groups - const [group, setGroup] = usePersistedOverlayState("cameraGroup"); + const [group, setGroup] = usePersistedOverlayState( + "cameraGroup", + "default" as string, + ); const groups = useMemo(() => { if (!config) { @@ -78,24 +81,24 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) { currentGroups={groups} /> - + - Home + All Cameras {groups.map(([name, config]) => { @@ -109,7 +112,7 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) { : "text-muted-foreground bg-secondary" } size="xs" - onClick={() => setGroup(name, group != undefined)} + onClick={() => setGroup(name, group != "default")} onMouseEnter={() => (isDesktop ? showTooltip(name) : null)} onMouseLeave={() => (isDesktop ? showTooltip(undefined) : null)} > diff --git a/web/src/pages/Live.tsx b/web/src/pages/Live.tsx index 4d7b58780..ba64e5680 100644 --- a/web/src/pages/Live.tsx +++ b/web/src/pages/Live.tsx @@ -11,10 +11,13 @@ function Live() { const { data: config } = useSWR("config"); const [selectedCameraName, setSelectedCameraName] = useOverlayState("camera"); - const [cameraGroup] = usePersistedOverlayState("cameraGroup"); + const [cameraGroup] = usePersistedOverlayState( + "cameraGroup", + "default" as string, + ); const includesBirdseye = useMemo(() => { - if (config && cameraGroup) { + if (config && cameraGroup && cameraGroup != "default") { return config.camera_groups[cameraGroup].cameras.includes("birdseye"); } else { return false; @@ -26,7 +29,7 @@ function Live() { return []; } - if (cameraGroup) { + if (cameraGroup && cameraGroup != "default") { const group = config.camera_groups[cameraGroup]; return Object.values(config.cameras) .filter((conf) => conf.enabled && group.cameras.includes(conf.name))