Skip to content

Commit

Permalink
Merge pull request #61 from FleekHQ/fix-close-on-darwin
Browse files Browse the repository at this point in the history
Fix close window on darwin
  • Loading branch information
gpuente authored Jun 10, 2020
2 parents 3c1113d + 3935152 commit 7c35372
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 7c35372

Please sign in to comment.