ELECTRON-816: add checks for crash events when it is killed (#544)

Currently on Windows, when the app is killed, a crash event is emitted which sends the wrong signal to the user that the app actually crashed which isn't the case because the app was in fact killed. So, this PR adds an extra check to see if the app was killed and shows the crash dialog based on that.
This commit is contained in:
Vishwas Shashidhar
2019-01-11 11:37:59 +05:30
committed by GitHub
parent 0bb617aab3
commit 28d9826236
6 changed files with 61 additions and 15 deletions

View File

@@ -111,7 +111,14 @@ function openBasicAuthWindow(windowName, hostname, isValidCredentials, clearSett
}
});
basicAuthWindow.webContents.on('crashed', function () {
basicAuthWindow.webContents.on('crashed', function (event, killed) {
log.send(logLevels.INFO, `Basic Auth Window crashed! Killed? ${killed}`);
if (killed) {
return;
}
const options = {
type: 'error',
title: i18n.getMessageFor('Renderer Process Crashed'),
@@ -167,4 +174,4 @@ function closeAuthWindow(clearSettings) {
module.exports = {
openBasicAuthWindow: openBasicAuthWindow
};
};