fix: prevent create multiple wake lock
This commit is contained in:
parent
1f8f3a6e8b
commit
c803e11505
|
@ -79,7 +79,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
|
||||||
var wakeLock = null;
|
var wakeLock = null;
|
||||||
|
|
||||||
var requestWakeLock = async function() {
|
var requestWakeLock = async function() {
|
||||||
if (!opts.prevent_screen_sleep_during_generation) return;
|
if (!opts.prevent_screen_sleep_during_generation || wakeLock) return;
|
||||||
try {
|
try {
|
||||||
wakeLock = await navigator.wakeLock.request('screen');
|
wakeLock = await navigator.wakeLock.request('screen');
|
||||||
console.log('Wake Lock is active.');
|
console.log('Wake Lock is active.');
|
||||||
|
|
Loading…
Reference in New Issue