Add onPanelWasDisposed

This commit is contained in:
Robert
2023-08-15 15:16:37 +01:00
parent 3764a7e567
commit ee78df683a

View File

@@ -108,6 +108,10 @@ export class DataExtensionsEditorView extends AbstractWebview<
}
});
panel.onDidDispose(async () => {
await this.onPanelWasDisposed();
});
await this.waitForPanelLoaded();
}
@@ -116,6 +120,13 @@ export class DataExtensionsEditorView extends AbstractWebview<
DataExtensionsEditorView.mostRecentlyActivePanel = panel;
}
private async onPanelWasDisposed(): Promise<void> {
const panel = await this.getPanel();
if (panel === DataExtensionsEditorView.mostRecentlyActivePanel) {
DataExtensionsEditorView.mostRecentlyActivePanel = undefined;
}
}
private async isTheMostRecentlyActivePanel(): Promise<boolean> {
const panel = await this.getPanel();
return panel === DataExtensionsEditorView.mostRecentlyActivePanel;