From b05049816b348165f53bcfe3aee7f1a350bbc032 Mon Sep 17 00:00:00 2001 From: liujuping Date: Wed, 2 Aug 2023 10:51:55 +0800 Subject: [PATCH] feat(workspace): when the sleep window is opened, the active window event is not triggered --- packages/workspace/src/workspace.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/workspace/src/workspace.ts b/packages/workspace/src/workspace.ts index e180d4a2f..55805aeca 100644 --- a/packages/workspace/src/workspace.ts +++ b/packages/workspace/src/workspace.ts @@ -266,10 +266,12 @@ export class Workspace implements IWorkspace { }); this.windows = [...this.windows, window]; this.editorWindowMap.set(window.id, window); - if (!sleep) { - this.window = window; - await this.window.init(); + if (sleep) { + this.emitChangeWindow(); + return; } + this.window = window; + await this.window.init(); this.emitChangeWindow(); this.emitChangeActiveWindow(); this.window?.updateState(WINDOW_STATE.active);