fixes #133582

上级 0c3d2cf5
......@@ -72,7 +72,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
return;
}
const updateMode = getMigratedSettingValue<string>(this.configurationService, 'update.mode', 'update.channel');
const updateMode = this.getUpdateMode();
const quality = this.getProductQuality(updateMode);
if (!quality) {
......@@ -104,6 +104,10 @@ export abstract class AbstractUpdateService implements IUpdateService {
}
}
private getUpdateMode(): 'none' | 'manual' | 'start' | 'default' {
return getMigratedSettingValue<'none' | 'manual' | 'start' | 'default'>(this.configurationService, 'update.mode', 'update.channel');
}
private getProductQuality(updateMode: string): string | undefined {
return updateMode === 'none' ? undefined : this.productService.quality;
}
......@@ -177,20 +181,18 @@ export abstract class AbstractUpdateService implements IUpdateService {
return Promise.resolve(undefined);
}
isLatestVersion(): Promise<boolean | undefined> {
async isLatestVersion(): Promise<boolean | undefined> {
if (!this.url) {
return Promise.resolve(undefined);
return undefined;
} else if (this.getUpdateMode() === 'none') {
return false;
}
return this.requestService.request({ url: this.url }, CancellationToken.None).then(context => {
// The update server replies with 204 (No Content) when no
// update is available - that's all we want to know.
if (context.res.statusCode === 204) {
return true;
} else {
return false;
}
});
const context = await this.requestService.request({ url: this.url }, CancellationToken.None);
// The update server replies with 204 (No Content) when no
// update is available - that's all we want to know.
return context.res.statusCode === 204;
}
protected getUpdateType(): UpdateType {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册