Skip to content

Commit

Permalink
fixes #82229
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Oct 21, 2019
1 parent 06d1b4a commit aa28cc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/parts/titlebar/menubarControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/update/browser/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
private readonly badgeDisposable = this._register(new MutableDisposable());
private updateStateContextKey: IContextKey<string>;

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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit aa28cc6

Please sign in to comment.