Merge pull request #6914 from Atlante45/fix/shutdown-popup

Close all console popup on first confirmation
This commit is contained in:
Ryan Huffman 2016-01-25 11:25:50 -08:00
commit d4924879da

View file

@ -105,19 +105,23 @@ const ipcMain = electron.ipcMain;
var isShuttingDown = false;
function shutdown() {
if (!isShuttingDown) {
var idx = 0;
// if the home server is running, show a prompt before quit to ask if the user is sure
if (homeServer.state == ProcessGroupStates.STARTED) {
idx = dialog.showMessageBox({
dialog.showMessageBox({
type: 'question',
buttons: ['Yes', 'No'],
title: 'Are you sure?',
message: 'Quitting will stop your Server Console and your Home domain will no longer be running.'
});
}, shutdownCallback);
} else {
shutdownCallback(0);
}
if (idx == 0) {
}
}
function shutdownCallback(idx) {
if (idx == 0 && !isShuttingDown) {
isShuttingDown = true;
userConfig.save(configPath);
@ -146,7 +150,6 @@ function shutdown() {
});
}
}
}
}
function deleteOldFiles(directoryPath, maxAgeInSeconds, filenameRegex) {