Refactor ZenWorkspaces to handle changing workspaces and update context menu

This commit is contained in:
mr. M 2024-10-12 21:15:34 +02:00
parent 1396523f3b
commit 600d0d7149
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -141,7 +141,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
activeWorkspace = workspaces.workspaces[0]; activeWorkspace = workspaces.workspaces[0];
Services.prefs.setStringPref('zen.workspaces.active', activeWorkspace.uuid); 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; return;
} }
let activeWorkspace = await parent.ZenWorkspaces.getActiveWorkspace(); let activeWorkspace = await parent.ZenWorkspaces.getActiveWorkspace();
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
if (workspaceID === activeWorkspace.uuid) { if (workspaceID === activeWorkspace.uuid) {
return; return;
} }
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID }); await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID });
} }