From 39c51435ca63aa774fc8c043389ce2f3080036ba Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 30 Jul 2021 07:37:33 +0300 Subject: [PATCH] avoid recursion when closing regexp tester --- edit/regexp-tester.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/edit/regexp-tester.js b/edit/regexp-tester.js index d0e0cee5..8d9f06cc 100644 --- a/edit/regexp-tester.js +++ b/edit/regexp-tester.js @@ -12,8 +12,6 @@ const regexpTester = (() => { let isWatching = false; let isShown = false; - window.on('closeHelp', () => regexpTester.toggle(false)); - return { toggle(state = !isShown) { @@ -23,6 +21,7 @@ const regexpTester = (() => { chrome.tabs.onUpdated.addListener(onTabUpdate); } helpPopup.show('', $create('.regexp-report')); + window.on('closeHelp', () => regexpTester.toggle(false), {once: true}); isShown = true; } else if (!state && isShown) { unwatch();