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

This commit is contained in:
arthur simas
2025-09-14 09:51:39 -03:00
committed by GitHub
parent 81d7c47129
commit c74e86dff2

View File

@@ -401,7 +401,7 @@ export default function LiveCameraView({
useEffect(() => { useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const screenOrientation = screen.orientation as 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 // Browser does not support ScreenOrientation APIs that we need
return; return;
} }