Skip to content

Commit

Permalink
Fix close window on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
gpuente committed Jun 10, 2020
1 parent d65f568 commit 3935152
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ const createWindow = () => {
mainWindow.webContents.openDevTools();
}

mainWindow.on('closed', () => (mainWindow = null));
mainWindow.on('closed', () => mainWindow = null);

mainWindow.on('close', (event) => {
if (app.quitting) {
mainWindow = null;
} else {
event.preventDefault();
mainWindow.hide();
}
});

destroyStream = registerEvents(mainWindow);
};
Expand All @@ -65,5 +74,9 @@ app.on('window-all-closed', () => {
app.on('activate', () => {
if (!mainWindow) {
createWindow();
} else {
mainWindow.show();
}
});

app.on('before-quit', () => app.quitting = true);

0 comments on commit 3935152

Please sign in to comment.