Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
quit app on non-darwin platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jan 19, 2017
1 parent c3407ea commit a5e9a06
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ process.on('uncaughtException', function (err) {
console.log(err);
})

let darwin = process.platform === 'darwin'

// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (!darwin) {
app.quit()
}
})

function createWindow () {

// Load the previous state with fallback to defaults
Expand Down Expand Up @@ -49,7 +60,7 @@ function createWindow () {
if (willQuitApp) {
/* the user tried to quit the app */
win = null;
} else {
} else if(darwin) {
/* the user only tried to close the window */
e.preventDefault();
win.hide();
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName" : "Standard Notes",
"description": "A standard notes app with an un-standard focus on longevity, portability, and privacy.",
"author": "Standard Notes <[email protected]>",
"version" : "0.1.1",
"version" : "0.1.2",
"dependencies" : {
"electron-window-state": "^4.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "standard-notes",
"version": "0.1.1",
"version": "0.1.2",
"main": "./app/index.js",
"devDependencies": {
"electron": "^1.4.14",
Expand Down

0 comments on commit a5e9a06

Please sign in to comment.