From 53beea2768acd5f45aeae046bdf58df896923d1b Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:24:49 +0200 Subject: [PATCH] refactor: prevent calling undefined (#521) --- apps/client/src/common/hooks/useFullscreen.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/common/hooks/useFullscreen.ts b/apps/client/src/common/hooks/useFullscreen.ts index 2beb1c2b5..57f8e64aa 100644 --- a/apps/client/src/common/hooks/useFullscreen.ts +++ b/apps/client/src/common/hooks/useFullscreen.ts @@ -42,7 +42,7 @@ export default function useFullscreen() { }); } else if (element.webkitRequestFullscreen) { // iOS Safari fullscreen API is supported - element.webkitRequestFullscreen().catch(() => { + element.webkitRequestFullscreen?.().catch(() => { /* nothing to do */ }); } @@ -55,7 +55,7 @@ export default function useFullscreen() { }); } else if ((document as WebkitDocument).webkitExitFullscreen) { // iOS Safari fullscreen API is supported - (document as WebkitDocument).webkitExitFullscreen().catch(() => { + (document as WebkitDocument).webkitExitFullscreen?.().catch(() => { /* nothing to do */ }); }