Skip to content

Commit

Permalink
fix(macosquit): fixes application quit dialog on macOS (#566)
Browse files Browse the repository at this point in the history
fixes #440
  • Loading branch information
2xAA authored Mar 11, 2021
1 parent 2911acb commit 134fffd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ let mm;

let projectNames = ["default"];
let currentProject = "default";
let shouldCloseMainWindow = false;
let shouldCloseMainWindowAndQuit = false;

const windowPrefs = {
colorPicker: {
Expand Down Expand Up @@ -196,8 +196,8 @@ const windowPrefs = {

if (!isDevelopment || process.env.IS_TEST) {
window.on("close", async e => {
if (shouldCloseMainWindow) {
shouldCloseMainWindow = false;
if (shouldCloseMainWindowAndQuit) {
app.quit();
return;
}

Expand All @@ -211,7 +211,7 @@ const windowPrefs = {
});

if (response === 0) {
shouldCloseMainWindow = true;
shouldCloseMainWindowAndQuit = true;
window.close();
}
});
Expand Down

0 comments on commit 134fffd

Please sign in to comment.