avoid recursion when closing regexp tester

This commit is contained in:
tophf 2021-07-30 07:37:33 +03:00
parent a46bb103c5
commit 39c51435ca

View File

@ -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();