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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}