mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-17 20:12:36 +00:00
feat: Always make sure we are assigning the correct space ID, b=no-bug, c=workspaces
This commit is contained in:
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user