Skip to content
Permalink
Browse files

Allow prerelease updates

  • Loading branch information...
Manuel-777 committed May 11, 2019
1 parent b597078 commit e310d6e70e734b2ee83a5727e6ace03f30b5a354
Showing with 23 additions and 8 deletions.
  1. +11 −6 main.js
  2. +2 −1 window_background/background.js
  3. +10 −1 window_main/renderer.js
17 main.js
@@ -13,6 +13,12 @@ const {
const path = require("path");
const fs = require("fs");
const {autoUpdater} = require("electron-updater");
const Store = require("./store.js");

var rememberStore = new Store({
configName: "remember",
defaults: {}
});

app.setAppUserModelId("com.github.manuel777.mtgatool");

@@ -73,15 +79,14 @@ function startUpdater() {
updaterWindow.show();
});

let betaChannel = rememberStore.get("settings.beta_channel");
if (betaChannel) {
autoUpdater.allowPrerelease = true;
}

autoUpdater.checkForUpdatesAndNotify();
}

/*
autoUpdater.on("checking-for-update", () => {
});
autoUpdater.on("update-available", info => {
});
*/
autoUpdater.on("update-not-available", info => {
console.log("Update not available", info);
if (mainWindow) {
@@ -86,7 +86,8 @@ const rememberCfg = {
settings: {
auto_login: false,
launch_to_tray: false,
remember_me: true
remember_me: true,
beta_channel: false
}
};

@@ -2208,6 +2208,13 @@ function open_settings(openSection) {
section.appendTo(div);
section.append('<div class="settings_title">Behaviour</div>');

add_checkbox(
section,
"Beta updates channel",
"settings_betachannel",
settings.beta_channel,
"updateAppSettings()"
);
add_checkbox(
section,
"Login automatically",
@@ -2875,9 +2882,11 @@ function updateUserSettings() {
function updateAppSettings() {
const auto_login = document.getElementById("settings_autologin").checked;
let launch_to_tray = document.getElementById("settings_launchtotray").checked;
let beta_channel = document.getElementById("settings_betachannel").checked;
const rSettings = {
auto_login,
launch_to_tray
launch_to_tray,
beta_channel
};
ipc_send("save_app_settings", rSettings);
}

0 comments on commit e310d6e

Please sign in to comment.
You can’t perform that action at this time.