fix settings check in updater code

This commit is contained in:
Evan Simkowitz 2024-09-03 19:16:04 -07:00
parent c02bf78e82
commit b7ed626667
No known key found for this signature in database

View File

@ -18,16 +18,16 @@ export class Updater {
private _status: UpdaterStatus; private _status: UpdaterStatus;
lastUpdateCheck: Date; lastUpdateCheck: Date;
constructor(options: AutoUpdateOpts) { constructor(settings: SettingsType) {
this.intervalms = options.intervalms; this.intervalms = settings["autoupdate:intervalms"];
this.autoCheckEnabled = options.enabled; this.autoCheckEnabled = settings["autoupdate:enabled"];
this._status = "up-to-date"; this._status = "up-to-date";
this.lastUpdateCheck = new Date(0); this.lastUpdateCheck = new Date(0);
this.autoCheckInterval = null; this.autoCheckInterval = null;
this.availableUpdateReleaseName = null; this.availableUpdateReleaseName = null;
autoUpdater.autoInstallOnAppQuit = options.installonquit; autoUpdater.autoInstallOnAppQuit = settings["autoupdate:installonquit"];
autoUpdater.removeAllListeners(); autoUpdater.removeAllListeners();
@ -195,8 +195,8 @@ export async function configureAutoUpdater() {
try { try {
console.log("Configuring updater"); console.log("Configuring updater");
const autoUpdateOpts = (await services.FileService.GetSettingsConfig()).autoupdate; const settings = (await services.FileService.GetFullConfig()).settings;
updater = new Updater(autoUpdateOpts); updater = new Updater(settings);
await updater.start(); await updater.start();
} catch (e) { } catch (e) {
console.warn("error configuring updater", e.toString()); console.warn("error configuring updater", e.toString());