From 0067dfeacc3ecaf1215f1b9026c500bff31761e6 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 14 Sep 2019 15:29:43 -0400 Subject: [PATCH] Remove redundant call of popupTimerClear Also use explicit null checks rather than truthy checks. --- ext/fg/js/frontend.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 31b43ad3..c98a9a33 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -77,7 +77,7 @@ class Frontend { } onMouseOver(e) { - if (e.target === this.popup.container && this.popupTimer) { + if (e.target === this.popup.container && this.popupTimer !== null) { this.popupTimerClear(); } } @@ -269,12 +269,11 @@ class Frontend { } popupTimerSet(callback) { - this.popupTimerClear(); this.popupTimer = window.setTimeout(callback, this.options.scanning.delay); } popupTimerClear() { - if (this.popupTimer) { + if (this.popupTimer !== null) { window.clearTimeout(this.popupTimer); this.popupTimer = null; }