feat: Always make sure we are assigning the correct space ID, b=no-bug, c=workspaces

This commit is contained in:
mr. m
2025-12-18 14:08:20 +01:00
parent 16d31a1045
commit 50b14012c5

View File

@@ -748,13 +748,13 @@ class nsZenWorkspaces {
}
set activeWorkspace(value) {
if (value === this.#activeWorkspace) {
return;
}
const spaces = this.getWorkspaces();
if (!spaces.some((ws) => ws.uuid === value)) {
value = spaces[0]?.uuid || '';
}
if (value === this.#activeWorkspace) {
return;
}
this.#activeWorkspace = value;
if (this.privateWindowOrDisabled) {
return;
@@ -851,6 +851,9 @@ class nsZenWorkspaces {
}
async restoreWorkspacesFromSessionStore(aWinData = {}) {
if (this.#hasInitialized) {
return;
}
this._workspaceCache = aWinData.spaces?.length
? aWinData.spaces
: [await this.createAndSaveWorkspace('Space', undefined, true)];