Fix unresponsive handler being attached many times

This commit is contained in:
Martin Fournier 2022-01-04 18:16:07 -05:00
parent 772317a4f1
commit de8e5ef441

@ -48,11 +48,12 @@ function promptForReload(window) {
} }
function attachUnresponsiveAppHandler(window) { function attachUnresponsiveAppHandler(window) {
window.on('unresponsive', () => promptForReload(window)); window.unresponsiveHandler = () => promptForReload(window);
window.on('unresponsive', window.unresponsiveHandler);
} }
function detachUnresponsiveAppHandler(window) { function detachUnresponsiveAppHandler(window) {
window.off('unresponsive', () => promptForReload(window)); window.off('unresponsive', window.unresponsiveHandler);
} }
function showErrorBox(title, error) { function showErrorBox(title, error) {