Add option to enable/disable auto updater

This commit is contained in:
Agampreet Singh
2023-06-12 00:49:47 +05:30
parent d2ed102ccc
commit 0ba2721ea3
2 changed files with 33 additions and 2 deletions

View File

@@ -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...`);

View File

@@ -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",