mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Improve active workspace selection logic in ZenWorkspaces
This commit is contained in:
@@ -544,14 +544,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
activeWorkspace = await this.createAndSaveWorkspace('Default Workspace', true, '🏠');
|
||||
} else {
|
||||
activeWorkspace = await this.getActiveWorkspace();
|
||||
if (!activeWorkspace) {
|
||||
activeWorkspace = workspaces.workspaces.find((workspace) => workspace.default);
|
||||
this.activeWorkspace = activeWorkspace?.uuid;
|
||||
}
|
||||
if (!activeWorkspace) {
|
||||
activeWorkspace = workspaces.workspaces[0];
|
||||
this.activeWorkspace = activeWorkspace?.uuid;
|
||||
}
|
||||
this.activeWorkspace = activeWorkspace?.uuid;
|
||||
}
|
||||
try {
|
||||
if (activeWorkspace) {
|
||||
@@ -777,7 +770,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
|
||||
async getActiveWorkspace() {
|
||||
const workspaces = await this._workspaces();
|
||||
return workspaces.workspaces.find((workspace) => workspace.uuid === this.activeWorkspace) ?? workspaces.workspaces[0];
|
||||
return workspaces.workspaces.find((workspace) => workspace.uuid === this.activeWorkspace) ??
|
||||
workspaces.workspaces.find((workspace) => workspace.default) ?? workspaces.workspaces[0];
|
||||
}
|
||||
// Workspaces dialog UI management
|
||||
|
||||
|
Reference in New Issue
Block a user