aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-05 19:47:02 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-05 19:48:08 -0500
commita85ec440d6c04cc1633db37fdaff00a2d450d51e (patch)
tree7f91cd988b3d1bbd45093ee1906beefac220654b
parent83460bcdade28fe77908d3008444a23555f09487 (diff)
Fix overlapping popup timers
-rw-r--r--ext/fg/js/frontend.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index b9410f2c..e67008df 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -310,17 +310,21 @@ class Frontend {
async popupTimerWait() {
const delay = this.options.scanning.delay;
- this.popupTimerPromise = promiseTimeout(delay, true);
+ const promise = promiseTimeout(delay, true);
+ this.popupTimerPromise = promise;
try {
- return await this.popupTimerPromise;
+ return await promise;
} finally {
- this.popupTimerPromise = null;
+ if (this.popupTimerPromise === promise) {
+ this.popupTimerPromise = null;
+ }
}
}
popupTimerClear() {
if (this.popupTimerPromise !== null) {
this.popupTimerPromise.resolve(false);
+ this.popupTimerPromise = null;
}
}