Skip to content

Commit 3764a7e

Browse files
Split isTheMostRecentlyActivePanel into two methods
1 parent 552baa5 commit 3764a7e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export class DataExtensionsEditorView extends AbstractWebview<
9999
panel.reveal(undefined, true);
100100

101101
panel.onDidChangeViewState(async () => {
102-
if (await this.isTheMostRecentlyActivePanel()) {
102+
if (panel.active) {
103+
await this.onPanelBecameActive();
103104
await this.updateModelDetailsPanelState(
104105
this.externalApiUsages,
105106
this.databaseItem,
@@ -110,15 +111,14 @@ export class DataExtensionsEditorView extends AbstractWebview<
110111
await this.waitForPanelLoaded();
111112
}
112113

113-
private async isTheMostRecentlyActivePanel(): Promise<boolean> {
114+
private async onPanelBecameActive(): Promise<void> {
114115
const panel = await this.getPanel();
116+
DataExtensionsEditorView.mostRecentlyActivePanel = panel;
117+
}
115118

116-
if (panel.active) {
117-
DataExtensionsEditorView.mostRecentlyActivePanel = panel;
118-
return true;
119-
} else {
120-
return panel === DataExtensionsEditorView.mostRecentlyActivePanel;
121-
}
119+
private async isTheMostRecentlyActivePanel(): Promise<boolean> {
120+
const panel = await this.getPanel();
121+
return panel === DataExtensionsEditorView.mostRecentlyActivePanel;
122122
}
123123

124124
protected async getPanelConfig(): Promise<WebviewPanelConfig> {

0 commit comments

Comments
 (0)