Skip to content

Commit d88a3c1

Browse files
authored
Merge pull request AUTOMATIC1111#16588 from bluelovers/patch-3
chore(js): avoid lots of `Wake Lock is not supported.`
2 parents 38c8043 + ee0ad5c commit d88a3c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

javascript/progressbar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
7979
var wakeLock = null;
8080

8181
var requestWakeLock = async function() {
82-
if (!opts.prevent_screen_sleep_during_generation || wakeLock) return;
82+
if (!opts.prevent_screen_sleep_during_generation || wakeLock !== null) return;
8383
try {
8484
wakeLock = await navigator.wakeLock.request('screen');
8585
} catch (err) {
8686
console.error('Wake Lock is not supported.');
87+
wakeLock = false;
8788
}
8889
};
8990

0 commit comments

Comments
 (0)