fix(update): verify and apply the actual latest version
This commit is contained in:
@@ -895,17 +895,13 @@ export class AppController {
|
||||
this.lastUpdateCheckAt = Date.now();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public async installUpdate(onProgress?: (progress: UpdateInstallProgress) => void): Promise<UpdateInstallResult> {
|
||||
const cacheAgeMs = Date.now() - this.lastUpdateCheckAt;
|
||||
const cached = this.lastUpdateCheck && !this.lastUpdateCheck.error && cacheAgeMs <= 10 * 60 * 1000
|
||||
? this.lastUpdateCheck
|
||||
: undefined;
|
||||
const result = await runInstallWithResume(
|
||||
this.manager,
|
||||
() => installLatestUpdate(this.settings.updateRepo, cached, onProgress)
|
||||
);
|
||||
}
|
||||
|
||||
public async installUpdate(onProgress?: (progress: UpdateInstallProgress) => void): Promise<UpdateInstallResult> {
|
||||
const result = await runInstallWithResume(
|
||||
this.manager,
|
||||
() => installLatestUpdate(this.settings.updateRepo, undefined, onProgress)
|
||||
);
|
||||
if (result.started) {
|
||||
this.lastUpdateCheck = null;
|
||||
this.lastUpdateCheckAt = 0;
|
||||
|
||||
Reference in New Issue
Block a user