Skip to content

Commit

Permalink
update listener name
Browse files Browse the repository at this point in the history
Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Feb 23, 2023
1 parent e1820b5 commit 9b47318
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class WebviewContextKeys {
/**
* Context key representing the `viewType` of the active `WebviewWidget`, if any.
*/
activeWebviewPanelId: ContextKey<string | undefined>;
activeWebviewPanelId: ContextKey<string>;

@inject(ApplicationShell)
protected applicationShell: ApplicationShell;
Expand All @@ -35,15 +35,15 @@ export class WebviewContextKeys {

@postConstruct()
protected postConstruct(): void {
this.activeWebviewPanelId = this.contextKeyService.createKey('activeWebviewPanelId', undefined);
this.applicationShell.onDidChangeCurrentWidget(this.handleDidChangeActiveWidget, this);
this.activeWebviewPanelId = this.contextKeyService.createKey('activeWebviewPanelId', '');
this.applicationShell.onDidChangeCurrentWidget(this.handleDidChangeCurrentWidget, this);
}

protected handleDidChangeActiveWidget(change: FocusTracker.IChangedArgs<Widget>): void {
protected handleDidChangeCurrentWidget(change: FocusTracker.IChangedArgs<Widget>): void {
if (change.newValue instanceof WebviewWidget) {
this.activeWebviewPanelId.set(change.newValue.viewType);
} else {
this.activeWebviewPanelId.set(undefined);
this.activeWebviewPanelId.set('');
}
}
}

0 comments on commit 9b47318

Please sign in to comment.