mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-20 16:51:54 +00:00
fix: update workspace change logic and remove redundant event listener
This commit is contained in:
@@ -1986,9 +1986,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (workspaceID) {
|
if (workspaceID) {
|
||||||
if (tab.hasAttribute('change-workspace') && this.moveTabToWorkspace(tab, workspaceID))
|
if (tab.hasAttribute('change-workspace') && this.moveTabToWorkspace(tab, workspaceID)) {
|
||||||
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
||||||
|
tab.removeAttribute('change-workspace');
|
||||||
|
await this.changeWorkspace({ uuid: workspaceID }, { onInit: true });
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2251,13 +2253,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
if (matchingWorkspaces.length === 1) {
|
if (matchingWorkspaces.length === 1) {
|
||||||
const workspace = matchingWorkspaces[0];
|
const workspace = matchingWorkspaces[0];
|
||||||
if (workspace.uuid !== this.getActiveWorkspaceFromCache().uuid) {
|
if (workspace.uuid !== this.getActiveWorkspaceFromCache().uuid) {
|
||||||
window.addEventListener(
|
|
||||||
'TabSelected',
|
|
||||||
(event) => {
|
|
||||||
this.changeWorkspace(workspace, { alwaysChange: true });
|
|
||||||
},
|
|
||||||
{ once: true }
|
|
||||||
);
|
|
||||||
return [userContextId, true, workspace.uuid];
|
return [userContextId, true, workspace.uuid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user