avoid recursion when closing regexp tester
This commit is contained in:
parent
a46bb103c5
commit
39c51435ca
|
@ -12,8 +12,6 @@ const regexpTester = (() => {
|
||||||
let isWatching = false;
|
let isWatching = false;
|
||||||
let isShown = false;
|
let isShown = false;
|
||||||
|
|
||||||
window.on('closeHelp', () => regexpTester.toggle(false));
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
toggle(state = !isShown) {
|
toggle(state = !isShown) {
|
||||||
|
@ -23,6 +21,7 @@ const regexpTester = (() => {
|
||||||
chrome.tabs.onUpdated.addListener(onTabUpdate);
|
chrome.tabs.onUpdated.addListener(onTabUpdate);
|
||||||
}
|
}
|
||||||
helpPopup.show('', $create('.regexp-report'));
|
helpPopup.show('', $create('.regexp-report'));
|
||||||
|
window.on('closeHelp', () => regexpTester.toggle(false), {once: true});
|
||||||
isShown = true;
|
isShown = true;
|
||||||
} else if (!state && isShown) {
|
} else if (!state && isShown) {
|
||||||
unwatch();
|
unwatch();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user