From 0ba2721ea3a7dabd4ccfa0265e0d6c6299a32f21 Mon Sep 17 00:00:00 2001 From: Agampreet Singh <68941022+agam778@users.noreply.github.com> Date: Mon, 12 Jun 2023 00:49:47 +0530 Subject: [PATCH] Add option to enable/disable auto updater --- app/main.js | 4 +++- app/menu.js | 31 ++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/main.js b/app/main.js index 1b3d6c6..4aaccd6 100644 --- a/app/main.js +++ b/app/main.js @@ -334,7 +334,9 @@ app.on("ready", function () { console.log(response); }); }); - autoUpdater.checkForUpdatesAndNotify(); + if (getValue("autoupdater") === "true") { + autoUpdater.checkForUpdatesAndNotify(); + } if (getValue("discordrpcstatus") === "true") { loginToRPC(); setActivity(`Opening Microsoft 365...`); diff --git a/app/menu.js b/app/menu.js index f9e6f89..a8da883 100644 --- a/app/menu.js +++ b/app/menu.js @@ -102,6 +102,7 @@ getValueOrDefault("useragentstring", useragents.Windows); getValueOrDefault("discordrpcstatus", "false"); getValueOrDefault("blockadsandtrackers", "false"); getValueOrDefault("dynamicicons", "true"); +getValueOrDefault("autoupdater", "true"); const menulayout = [ ...(process.platform === "darwin" @@ -322,7 +323,35 @@ const menulayout = [ }, checked: getValue("discordrpcstatus") === "true", }, - { type: "separator" }, + { + label: "Enable Auto Updates", + type: "checkbox", + click: () => { + if (getValue("autoupdater") === "true") { + setValue("autoupdater", "false"); + dialog.showMessageBoxSync({ + type: "info", + title: "Auto Updates", + message: "Auto updates have been disabled.", + buttons: ["OK"], + }); + return; + } else if ( + getValue("autoupdater") === "false" || + getValue("autoupdater") === undefined + ) { + setValue("autoupdater", "true"); + dialog.showMessageBoxSync({ + type: "info", + title: "Auto Updates", + message: "Auto updates have been enabled.", + buttons: ["OK"], + }); + return; + } + }, + checked: getValue("autoupdater") === "true", + }, { label: "Enable Dynamic Icons", type: "checkbox",