Skip to content

Commit 4c5820c

Browse files
committed
Display webview actions correctly when webview is disposed
1 parent 7c568aa commit 4c5820c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/views/codeSnippetWebview.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class CodeSnippetWebview extends BaseWebview {
3232
});
3333

3434
panel.onDidDispose(() => {
35+
commands.executeCommand('setContext', this.codeSnippetPreviewActiveContextKey, false);
3536
this.panels.pop();
3637
this._onDidCloseAllWebviewPanels.fire();
3738
});

‎src/views/httpResponseWebview.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ export class HttpResponseWebview extends BaseWebview {
4747
});
4848

4949
panel.onDidDispose(() => {
50+
const response = this.panelResponses.get(panel);
51+
if (response === HttpResponseWebview.activePreviewResponse) {
52+
commands.executeCommand('setContext', this.httpResponsePreviewActiveContextKey, false);
53+
HttpResponseWebview.activePreviewResponse = undefined;
54+
}
55+
5056
const index = this.panels.findIndex(v => v === panel);
5157
if (index !== -1) {
5258
this.panels.splice(index, 1);

0 commit comments

Comments
 (0)