From f927f806ba602867948654947dce4d27dfc07ebf Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 24 Oct 2019 20:07:17 -0400 Subject: Move check --- ext/fg/js/frontend.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ext/fg') diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 957f57c9..1ab3c1a1 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -319,7 +319,10 @@ class Frontend { } const textSource = docRangeFromPoint(x, y, this.options); - if (textSource === null) { + if ( + textSource === null || + (this.textSourceLast !== null && this.textSourceLast.equals(textSource)) + ) { return; } @@ -337,11 +340,9 @@ class Frontend { let hideResults = false; try { - if (!this.textSourceLast || !this.textSourceLast.equals(textSource)) { - this.pendingLookup = true; - const focus = (cause === 'mouse'); - hideResults = !await this.searchTerms(textSource, focus) && !await this.searchKanji(textSource, focus); - } + this.pendingLookup = true; + const focus = (cause === 'mouse'); + hideResults = !await this.searchTerms(textSource, focus) && !await this.searchKanji(textSource, focus); } catch (e) { if (window.yomichan_orphaned) { if (textSource && this.options.scanning.modifier !== 'none') { -- cgit v1.2.3