Add checkIsUpdated method to AutoUpdaterService

This commit is contained in:
Shidorien
2024-01-05 16:38:22 +01:00
parent 76ed1b09a1
commit 3217addaa6
2 changed files with 11 additions and 9 deletions
+11 -4
View File
@@ -5,6 +5,7 @@ import { ModalService } from "renderer/services/modale.service";
import { ChangelogModal } from "renderer/components/modal/modal-types/chabgelog-modal/changelog-modal.component";
import { ConfigurationService } from "./configuration.service";
import { Observable, lastValueFrom } from "rxjs";
import { lte } from "semver";
export interface Changelog {
[version: string]: ChangelogVersion;
@@ -111,8 +112,14 @@ export class AutoUpdaterService {
this.modal.openModal(ChangelogModal, changelog);
}
lastValueFrom(autoUpdater.getAppVersion()).then(appVersion => {
const lastAppVersion = autoUpdater.getLastAppVersion();
if (!lastAppVersion) { return;}
if(lte(appVersion,lastAppVersion)){ return; }
public checkIsUpdated(): void {
lastValueFrom(this.getAppVersion()).then(appVersion => {
const lastAppVersion = this.getLastAppVersion();
if (!lastAppVersion) { return;}
if(lte(appVersion,lastAppVersion)){ return; }
this.setLastAppVersion();
this.showChangelog(appVersion);
});
}
}