mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
ui: finalize PR
This commit is contained in:
committed by
Aiden McClelland
parent
39accaa382
commit
ba04b7c431
@@ -38,7 +38,7 @@ export class OsUpdateService {
|
||||
this.serverModel.watch().versionInstalled.pipe(take(1)),
|
||||
this.apiService.getVersionLatest(),
|
||||
]).pipe(
|
||||
map(([vi, vl]) => updateIsAvailable(this.emver, vi, vl.versionLatest)),
|
||||
map(([vi, vl]) => this.updateIsAvailable(vi, vl.versionLatest) ? vl : undefined),
|
||||
catchError(e => {
|
||||
console.error(`OsUpdateService Error: ${e}`)
|
||||
return of(undefined)
|
||||
@@ -59,11 +59,6 @@ export class OsUpdateService {
|
||||
}
|
||||
}
|
||||
|
||||
async checkForAppsUpdate (): Promise<boolean> {
|
||||
const availableApps = await this.apiService.getAvailableApps()
|
||||
return !!availableApps.find(app => this.emver.compare(app.versionInstalled, app.versionLatest) === -1)
|
||||
}
|
||||
|
||||
async updateEmbassyOS (versionLatest: string): Promise<void> {
|
||||
await this.apiService.updateAgent(versionLatest)
|
||||
this.serverModel.update({ status: ServerStatus.UPDATING })
|
||||
@@ -71,8 +66,3 @@ export class OsUpdateService {
|
||||
await this.navCtrl.navigateRoot('/embassy')
|
||||
}
|
||||
}
|
||||
|
||||
function updateIsAvailable (e: Emver, vi: string, vl: string): string | undefined {
|
||||
if (!vi || !vl) return undefined
|
||||
return e.compare(vi, vl) === -1 ? vl : undefined
|
||||
}
|
||||
Reference in New Issue
Block a user