Force single app instance on windows

fixes issue #236
This commit is contained in:
Julian Gisser
2016-08-16 10:28:21 +02:00
parent 1d851fd6de
commit 293d7134b4

View File

@@ -128,6 +128,16 @@ const trayImages = function() {
}();
var willAppQuit = false;
// If there is already an instance, activate the window in the existing instace and quit this one
if(app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
mainWindow.show()
}
})) {
app.quit()
}
function shouldShowTrayIcon() {
if (process.platform === 'win32') {
return true;