From 258aac466af2117ded3b7b78a632b43e766e4c99 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 4 Jan 2019 16:47:38 +0100 Subject: [PATCH] :lipstick: cleanup abstract update service --- .../update/electron-main/abstractUpdateService.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index 4a81814c10a..481fa7cac4a 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -56,8 +56,8 @@ export abstract class AbstractUpdateService implements IUpdateService { return; } - const quality = this.getProductQuality(); - const channel = this.configurationService.getValue('update.channel'); + const updateChannel = this.configurationService.getValue('update.channel'); + const quality = this.getProductQuality(updateChannel); if (!quality) { this.logService.info('update#ctor - updates are disabled by user preference'); @@ -72,7 +72,7 @@ export abstract class AbstractUpdateService implements IUpdateService { this.setState(State.Idle(this.getUpdateType())); - if (channel === 'manual') { + if (updateChannel === 'manual') { this.logService.info('update#ctor - manual checks only; automatic updates are disabled by user preference'); return; } @@ -81,9 +81,8 @@ export abstract class AbstractUpdateService implements IUpdateService { this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err)); } - private getProductQuality(): string | undefined { - const quality = this.configurationService.getValue('update.channel'); - return quality === 'none' ? undefined : product.quality; + private getProductQuality(updateChannel: string): string | undefined { + return updateChannel === 'none' ? undefined : product.quality; } private scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise {