Skip to content

Commit ee78df6

Browse files
Add onPanelWasDisposed
1 parent 3764a7e commit ee78df6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

extensions/ql-vscode/src/data-extensions-editor/data-extensions-editor-view.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export class DataExtensionsEditorView extends AbstractWebview<
108108
}
109109
});
110110

111+
panel.onDidDispose(async () => {
112+
await this.onPanelWasDisposed();
113+
});
114+
111115
await this.waitForPanelLoaded();
112116
}
113117

@@ -116,6 +120,13 @@ export class DataExtensionsEditorView extends AbstractWebview<
116120
DataExtensionsEditorView.mostRecentlyActivePanel = panel;
117121
}
118122

123+
private async onPanelWasDisposed(): Promise<void> {
124+
const panel = await this.getPanel();
125+
if (panel === DataExtensionsEditorView.mostRecentlyActivePanel) {
126+
DataExtensionsEditorView.mostRecentlyActivePanel = undefined;
127+
}
128+
}
129+
119130
private async isTheMostRecentlyActivePanel(): Promise<boolean> {
120131
const panel = await this.getPanel();
121132
return panel === DataExtensionsEditorView.mostRecentlyActivePanel;

0 commit comments

Comments
 (0)