@@ -9,7 +9,7 @@ import { Action } from 'vs/base/common/actions';
99import { Disposable , MutableDisposable } from 'vs/base/common/lifecycle' ;
1010import { URI } from 'vs/base/common/uri' ;
1111import { IActivityService , NumberBadge , IBadge , ProgressBadge } from 'vs/workbench/services/activity/common/activity' ;
12- import { IInstantiationService , optional } from 'vs/platform/instantiation/common/instantiation' ;
12+ import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1313import { GLOBAL_ACTIVITY_ID } from 'vs/workbench/common/activity' ;
1414import { IOpenerService } from 'vs/platform/opener/common/opener' ;
1515import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
@@ -30,10 +30,6 @@ import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/com
3030import { IHostService } from 'vs/workbench/services/host/browser/host' ;
3131import { IProductService } from 'vs/platform/product/common/productService' ;
3232
33- // TODO@Joao layer breaker
34- // tslint:disable-next-line: layering
35- import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService' ;
36-
3733const CONTEXT_UPDATE_STATE = new RawContextKey < string > ( 'updateState' , StateType . Uninitialized ) ;
3834
3935let releaseNotesManager : ReleaseNotesManager | undefined = undefined ;
@@ -171,8 +167,6 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
171167 private readonly badgeDisposable = this . _register ( new MutableDisposable ( ) ) ;
172168 private updateStateContextKey : IContextKey < string > ;
173169
174- private context = `window:${ this . electronEnvironmentService ? this . electronEnvironmentService . windowId : 'any' } ` ;
175-
176170 constructor (
177171 @IStorageService private readonly storageService : IStorageService ,
178172 @IInstantiationService private readonly instantiationService : IInstantiationService ,
@@ -182,7 +176,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
182176 @IActivityService private readonly activityService : IActivityService ,
183177 @IContextKeyService private readonly contextKeyService : IContextKeyService ,
184178 @IProductService private readonly productService : IProductService ,
185- @optional ( IElectronEnvironmentService ) private readonly electronEnvironmentService : IElectronEnvironmentService
179+ @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService : IWorkbenchEnvironmentService
186180 ) {
187181 super ( ) ;
188182 this . state = updateService . state ;
@@ -218,7 +212,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
218212 case StateType . Idle :
219213 if ( state . error ) {
220214 this . onError ( state . error ) ;
221- } else if ( this . state . type === StateType . CheckingForUpdates && this . state . context === this . context ) {
215+ } else if ( this . state . type === StateType . CheckingForUpdates && this . state . context === this . workbenchEnvironmentService . configuration . sessionId ) {
222216 this . onUpdateNotAvailable ( ) ;
223217 }
224218 break ;
@@ -401,7 +395,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
401395 }
402396
403397 private registerGlobalActivityActions ( ) : void {
404- CommandsRegistry . registerCommand ( 'update.check' , ( ) => this . updateService . checkForUpdates ( this . context ) ) ;
398+ CommandsRegistry . registerCommand ( 'update.check' , ( ) => this . updateService . checkForUpdates ( this . workbenchEnvironmentService . configuration . sessionId ) ) ;
405399 MenuRegistry . appendMenuItem ( MenuId . GlobalActivity , {
406400 group : '6_update' ,
407401 command : {
0 commit comments