Fix overlapping popup timers
This commit is contained in:
parent
83460bcdad
commit
a85ec440d6
@ -310,17 +310,21 @@ class Frontend {
|
|||||||
|
|
||||||
async popupTimerWait() {
|
async popupTimerWait() {
|
||||||
const delay = this.options.scanning.delay;
|
const delay = this.options.scanning.delay;
|
||||||
this.popupTimerPromise = promiseTimeout(delay, true);
|
const promise = promiseTimeout(delay, true);
|
||||||
|
this.popupTimerPromise = promise;
|
||||||
try {
|
try {
|
||||||
return await this.popupTimerPromise;
|
return await promise;
|
||||||
} finally {
|
} finally {
|
||||||
this.popupTimerPromise = null;
|
if (this.popupTimerPromise === promise) {
|
||||||
|
this.popupTimerPromise = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
popupTimerClear() {
|
popupTimerClear() {
|
||||||
if (this.popupTimerPromise !== null) {
|
if (this.popupTimerPromise !== null) {
|
||||||
this.popupTimerPromise.resolve(false);
|
this.popupTimerPromise.resolve(false);
|
||||||
|
this.popupTimerPromise = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user