mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-03-01 16:05:59 +08:00
chore(js): avoid lots of Wake Lock is not supported.
This commit is contained in:
parent
984b952eb3
commit
ee0ad5cceb
@ -79,11 +79,12 @@ 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 || wakeLock) return;
|
if (!opts.prevent_screen_sleep_during_generation || wakeLock !== null) return;
|
||||||
try {
|
try {
|
||||||
wakeLock = await navigator.wakeLock.request('screen');
|
wakeLock = await navigator.wakeLock.request('screen');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Wake Lock is not supported.');
|
console.error('Wake Lock is not supported.');
|
||||||
|
wakeLock = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user