mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 00:19:21 +00:00
fix: prevent unsupported wakelock
This commit is contained in:
committed by
Carlos Valente
parent
14e21214af
commit
cd39227af7
@@ -25,6 +25,11 @@ export function useWakelock() {
|
|||||||
const sentinel = wakeLockSentinelRef.current;
|
const sentinel = wakeLockSentinelRef.current;
|
||||||
if (!sentinel || sentinel.released) {
|
if (!sentinel || sentinel.released) {
|
||||||
wakeLockSentinelRef.current = null;
|
wakeLockSentinelRef.current = null;
|
||||||
|
|
||||||
|
if (!canUseWakeLock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
navigator.wakeLock
|
navigator.wakeLock
|
||||||
.request('screen')
|
.request('screen')
|
||||||
.then((sentinel) => {
|
.then((sentinel) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user