From 2c74233c21c27c45c79edb843cd5078a950b9ff6 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Thu, 24 Feb 2022 00:25:15 +0100 Subject: fixed NS never being auto-updated and more When #87 was merged an unnoticed problem slipped in where if Viper was running in a version that did not support auto-updates we would never auto-update Northstar. Now that's fixed, and the nsupdate option is completely implemented. I also took the liberty of removing the auto-update option in the settings page if Viper can't auto-update anyway, as it's useless if that's not possible. --- src/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 0e8364f..265e13d 100644 --- a/src/index.js +++ b/src/index.js @@ -55,6 +55,12 @@ function start() { ipcMain.on("savesettings", (event, obj) => {utils.saveSettings(obj)}) + ipcMain.on("can-autoupdate", (event) => { + if (! require("electron-updater").autoUpdater.isUpdaterActive()) { + win.webContents.send("cant-autoupdate") + } + }) + win.webContents.on("dom-ready", () => { win.webContents.send("mods", utils.mods.list()); }); @@ -62,9 +68,7 @@ function start() { if (utils.settings.autoupdate) { utils.updatevp(false) } else { - if (utils.settings.nsupdate) { - utils.update(); - } + utils.handleNorthstarUpdating(); } autoUpdater.on("update-downloaded", () => { -- cgit v1.2.3