diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index 2ec12a3f7220c..ff4424d9b8d26 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -444,9 +444,9 @@ export class CustomMenubarControl extends MenubarControl { return null; case StateType.Idle: - const windowId = this.electronEnvironmentService.windowId; + const context = `window:${this.electronEnvironmentService ? this.electronEnvironmentService.windowId : 'any'}`; return new Action('update.check', nls.localize({ key: 'checkForUpdates', comment: ['&& denotes a mnemonic'] }, "Check for &&Updates..."), undefined, true, () => - this.updateService.checkForUpdates({ windowId })); + this.updateService.checkForUpdates(context)); case StateType.CheckingForUpdates: return new Action('update.checking', nls.localize('checkingForUpdates', "Checking for Updates..."), undefined, false); diff --git a/src/vs/workbench/contrib/update/browser/update.ts b/src/vs/workbench/contrib/update/browser/update.ts index 72982e625d454..00b74f5f3213e 100644 --- a/src/vs/workbench/contrib/update/browser/update.ts +++ b/src/vs/workbench/contrib/update/browser/update.ts @@ -171,7 +171,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu private readonly badgeDisposable = this._register(new MutableDisposable()); private updateStateContextKey: IContextKey; - private windowId: number | undefined = this.electronEnvironmentService ? this.electronEnvironmentService.windowId : undefined; + private context = `window:${this.electronEnvironmentService ? this.electronEnvironmentService.windowId : 'any'}`; constructor( @IStorageService private readonly storageService: IStorageService, @@ -218,7 +218,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu case StateType.Idle: if (state.error) { this.onError(state.error); - } else if (this.state.type === StateType.CheckingForUpdates && this.state.context && this.state.context.windowId === this.windowId) { + } else if (this.state.type === StateType.CheckingForUpdates && this.state.context === this.context) { this.onUpdateNotAvailable(); } break; @@ -401,7 +401,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu } private registerGlobalActivityActions(): void { - CommandsRegistry.registerCommand('update.check', () => this.updateService.checkForUpdates({ windowId: this.windowId })); + CommandsRegistry.registerCommand('update.check', () => this.updateService.checkForUpdates(this.context)); MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { group: '6_update', command: {