From 504462258ae3d69e68364f2e7cf3fc179ff9a774 Mon Sep 17 00:00:00 2001 From: Shidorien Date: Thu, 21 Dec 2023 21:17:15 +0100 Subject: [PATCH] Refactor AutoUpdaterService methods to use LAST_VERSION instead of have-been-updated --- src/renderer/services/auto-updater.service.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/renderer/services/auto-updater.service.ts b/src/renderer/services/auto-updater.service.ts index 3a0d9739..f3792365 100644 --- a/src/renderer/services/auto-updater.service.ts +++ b/src/renderer/services/auto-updater.service.ts @@ -64,12 +64,12 @@ export class AutoUpdaterService { this.ipcService.sendLazy("install-update"); } - public getHaveBeenUpdated(): boolean { - return this.configurationService.get("have-been-updated"); + public getLastVersion(): string { + return this.configurationService.get("LAST_VERSION"); } - public setHaveBeenUpdated(value: boolean){ - this.configurationService.set("have-been-updated", value); + public setLastVersion(){ + lastValueFrom(this.getAppVersion()).then(v => this.configurationService.set("LAST_VERSION", v)); } private async getChangelog(): Promise { @@ -116,12 +116,9 @@ export class AutoUpdaterService { if (!version) { version = await lastValueFrom(this.getAppVersion()) } - - if(this.getHaveBeenUpdated()){ const changelog = await this.getChangelogVersion(version); this.modal.openModal(ChangelogModal, changelog); - } } catch(error){ this.ipcService.sendLazy("log-error", {args: error});