Skip to content

NVR with realtime local object detection for IP cameras

fix(web): handle undefined screen.orientation (#20064)

arthur simasc74e86dff269
diff --git a/web/src/views/live/LiveCameraView.tsx b/web/src/views/live/LiveCameraView.tsx
index b4d099dd78..5378f94c72 100644
--- a/web/src/views/live/LiveCameraView.tsx
+++ b/web/src/views/live/LiveCameraView.tsx
@@ -401,7 +401,7 @@ export default function LiveCameraView({
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const screenOrientation = screen.orientation as any;
- if (!screenOrientation.lock || !screenOrientation.unlock) {
+ if (!screenOrientation?.lock || !screenOrientation?.unlock) {
// Browser does not support ScreenOrientation APIs that we need
return;
}