diff --git a/electron/utils.js b/electron/utils.js index 03175b57b..17385b20e 100644 --- a/electron/utils.js +++ b/electron/utils.js @@ -48,11 +48,12 @@ function promptForReload(window) { } function attachUnresponsiveAppHandler(window) { - window.on('unresponsive', () => promptForReload(window)); + window.unresponsiveHandler = () => promptForReload(window); + window.on('unresponsive', window.unresponsiveHandler); } function detachUnresponsiveAppHandler(window) { - window.off('unresponsive', () => promptForReload(window)); + window.off('unresponsive', window.unresponsiveHandler); } function showErrorBox(title, error) {