feat(frontend): スリープ無効化機能

Resolve #11853
This commit is contained in:
syuilo 2023-09-20 10:02:39 +09:00
parent bb0b2df37e
commit bb460a1785
6 changed files with 60 additions and 37 deletions

View file

@ -202,6 +202,18 @@ export async function common(createVue: () => App<Element>) {
}
}, { immediate: true });
if (defaultStore.state.keepScreenOn) {
if ('wakeLock' in navigator) {
navigator.wakeLock.request('screen');
document.addEventListener('visibilitychange', async () => {
if (document.visibilityState === 'visible') {
navigator.wakeLock.request('screen');
}
});
}
}
//#region Fetch user
if ($i && $i.token) {
if (_DEV_) {