diff --git a/web/src/routes/Birdseye.jsx b/web/src/routes/Birdseye.jsx index 6d5df85e8..4f7a5e8ff 100644 --- a/web/src/routes/Birdseye.jsx +++ b/web/src/routes/Birdseye.jsx @@ -6,7 +6,7 @@ import Heading from '../components/Heading'; import WebRtcPlayer from '../components/WebRtcPlayer'; import '../components/MsePlayer'; import useSWR from 'swr'; -import { useMemo, useState } from 'preact/hooks'; +import { useMemo } from 'preact/hooks'; import CameraControlPanel from '../components/CameraControlPanel'; import { baseUrl } from '../api/baseUrl'; @@ -26,7 +26,7 @@ export default function Birdseye() { .map(([_, camera]) => camera.name); }, [config]); - const [isMaxWidth, setIsMaxWidth] = useState(false); + const [isMaxWidth, setIsMaxWidth] = usePersistence('birdseye-width', false); if (!config || !sourceIsLoaded) { return ; @@ -55,7 +55,7 @@ export default function Birdseye() { ); } - } else if (viewSource == 'webrtc' ) { + } else if (viewSource == 'webrtc') { player = ( @@ -66,7 +66,7 @@ export default function Birdseye() { } else { player = ( - + @@ -80,12 +80,14 @@ export default function Birdseye() { Birdseye - setIsMaxWidth(!isMaxWidth)} - > - Toggle width - + {!ptzCameras.length && ( + setIsMaxWidth(!isMaxWidth)} + > + Toggle width + + )} {config.birdseye.restream && ( ))} - )} - {/* Use dynamic class */} + + {' '} + {/* Use dynamic class */} {player} {ptzCameras.length ? ( - + Control Panel {ptzCameras.map((camera) => (