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];
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 });
}