Skip to content

Commit

Permalink
Quit app on linux/windows if the main window is closed (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Tangermann authored and hql287 committed Mar 2, 2018
1 parent 6f84b57 commit d7c5901
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ function createMainWindow() {
if (isDev) mainWindow.webContents.openDevTools({ mode: 'detach' });
});
mainWindow.on('close', event => {
event.preventDefault();
if (isDev) mainWindow.webContents.closeDevTools();
mainWindow.hide();
if (process.platform === 'darwin') {
event.preventDefault();
if (isDev) mainWindow.webContents.closeDevTools();
mainWindow.hide();
} else {
app.quit();
}
});
}

Expand Down

0 comments on commit d7c5901

Please sign in to comment.