Skip to content

Commit

Permalink
fix: Quit process behaviour on Mac (#119)
Browse files Browse the repository at this point in the history
* Ignore apple & IntelliJ files

* supress unused call to css/index.css

* Fix quit behaviour on MacOs

* Revert "supress unused call to css/index.css"

This reverts commit 679ff0a.
  • Loading branch information
giboow authored Feb 5, 2021
1 parent 1a673de commit b9d989b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ node_modules/
dist/
*_.*
*_

yarn-error.log

.idea/

.DS_Store
15 changes: 15 additions & 0 deletions app/main/window/hideOnClose.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
const { app } = require("electron");
const quit = require("../quit");



module.exports = function hideOnClose(win) {
let willQuitApp = false;

win.on("close", (event) => {

// Quit on Cmd + Q on Mac
if (willQuitApp && process.platform === 'darwin') {
quit();
}

if (!app.__isQuitting) {
event.preventDefault();
win.hide();
}
});

// Detect If the user decide to quit app
app.on('before-quit', () => willQuitApp = true);

};

0 comments on commit b9d989b

Please sign in to comment.