Skip to content

Commit 8bed67e

Browse files
authored
Update DockManager.ts
Update notifyOnActiveDocumentChange to async to avoid race conditions.
1 parent 5a69a6a commit 8bed67e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DockManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,12 @@ export class DockManager {
752752
});
753753
}
754754

755-
notifyOnActiveDocumentChange(panel: PanelContainer, oldActive: PanelContainer) {
756-
this.layoutEventListeners.forEach((listener) => {
755+
async notifyOnActiveDocumentChange(panel: PanelContainer, oldActive: PanelContainer) {
756+
for (const listener of this.layoutEventListeners) {
757757
if (listener.onActiveDocumentChange) {
758-
listener.onActiveDocumentChange(this, panel, oldActive);
758+
await listener.onActiveDocumentChange(this, panel, oldActive);
759759
}
760-
});
760+
}
761761
}
762762

763763
saveState() {

0 commit comments

Comments
 (0)