From 50f4d7d17dc8b6ce373a76f2d27ea12dd4c787ee Mon Sep 17 00:00:00 2001 From: kuuuube Date: Wed, 10 Apr 2024 09:47:49 -0400 Subject: [PATCH] Cleanup if statement --- ext/js/language/text-scanner.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 4330789ec6..bdbc117e8b 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -710,8 +710,10 @@ export class TextScanner extends EventDispatcher { if (!allowSearch) { return; } const inputInfo = this._getMatchingInputGroupFromEvent('touch', 'touchEnd', e); - if (inputInfo === null || !((inputInfo.input !== null && inputInfo.input.scanOnTouchRelease) || (inputInfo.input !== null && inputInfo.input.scanOnTouchTap && this._touchTapValid))) { return; } - void this._searchAtFromTouchEnd(x, y, inputInfo); + if (inputInfo === null || inputInfo.input === null) { return; } + if (inputInfo.input.scanOnTouchRelease || (inputInfo.input.scanOnTouchTap && this._touchTapValid)) { + void this._searchAtFromTouchEnd(x, y, inputInfo); + } } /**