Skip to content

Commit

Permalink
Bump Altus version & make tab close prompt setting work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Oct 4, 2020
1 parent aa1430f commit 5a49d7a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1,474 deletions.
22 changes: 13 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ const mainMenuTemplate = [
label: "Close Active Tab",
accelerator: "CmdOrCtrl+W",
click() {
if (app.showExitPrompt === true) {
if (
Array.from(settings.get("settings")).find(
(s) => s.id === "tabClosePrompt"
).value === true
) {
confirmCloseTab(mainWindow);
} else {
mainWindow.webContents.send("close-tab");
Expand Down Expand Up @@ -602,6 +606,14 @@ let trayIconImage = nativeImage.createFromPath(
)
);

// Sets the default settings
let settings = new Store({
name: "settings",
defaults: {
settings: defaultSettings,
},
});

// Using singleInstanceLock for making app single instance
const singleInstanceLock = app.requestSingleInstanceLock();

Expand All @@ -624,14 +636,6 @@ if (!singleInstanceLock) {
}
});

// Sets the default settings
let settings = new Store({
name: "settings",
defaults: {
settings: defaultSettings,
},
});

app.on("ready", () => {
// Create the main window object
mainWindow = new BrowserWindow({
Expand Down
Loading

0 comments on commit 5a49d7a

Please sign in to comment.