diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 12bb56a87..594fe6423 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -204,12 +204,16 @@ export async function common(createVue: () => App) { if (defaultStore.state.keepScreenOn) { if ('wakeLock' in navigator) { - navigator.wakeLock.request('screen'); - - document.addEventListener('visibilitychange', async () => { - if (document.visibilityState === 'visible') { - navigator.wakeLock.request('screen'); - } + navigator.wakeLock.request('screen') + .then(() => { + document.addEventListener('visibilitychange', async () => { + if (document.visibilityState === 'visible') { + navigator.wakeLock.request('screen'); + } + }); + }) + .catch(() => { + // If Permission fails on an AppleDevice such as Safari }); } }