Merge pull request #2338 from MartinFournier/fix/electron-unresponsive-handler

Fix unresponsive handler being attached many times
This commit is contained in:
hydroflame 2022-01-04 19:02:34 -05:00 committed by GitHub
commit 338953fa1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {