From 600d0d7149672e753abaa2defa57cc2a649d69bd Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 12 Oct 2024 21:15:34 +0200 Subject: [PATCH] Refactor ZenWorkspaces to handle changing workspaces and update context menu --- src/ZenWorkspaces.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index 6b07389..58fe842 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -141,7 +141,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { activeWorkspace = workspaces.workspaces[0]; Services.prefs.setStringPref('zen.workspaces.active', activeWorkspace.uuid); } - this.changeWorkspace(activeWorkspace, true); + await SessionStore.promiseInitialized; + await this.changeWorkspace(activeWorkspace, true); } } } @@ -730,10 +731,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return; } let activeWorkspace = await parent.ZenWorkspaces.getActiveWorkspace(); + this._lastSelectedWorkspaceTabs[workspaceID] = tab; if (workspaceID === activeWorkspace.uuid) { return; } - this._lastSelectedWorkspaceTabs[workspaceID] = tab; await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID }); }