mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-08 10:56:36 +00:00
Refactor ZenWorkspaces to enhance tab switching logic with asynchronous handling for improved workspace management
This commit is contained in:
@@ -2273,10 +2273,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
switchIfNeeded(browser) {
|
||||
const tab = gBrowser.getTabForBrowser(browser);
|
||||
const workspaceId = tab.getAttribute('zen-workspace-id');
|
||||
if (!tab.hasAttribute('zen-essential') && workspaceId !== this.activeWorkspace) {
|
||||
this.changeWorkspace({ uuid: workspaceId });
|
||||
}
|
||||
return new Promise(async(resolve) => {
|
||||
const tab = gBrowser.getTabForBrowser(browser);
|
||||
const workspaceId = tab.getAttribute('zen-workspace-id');
|
||||
if (!tab.hasAttribute('zen-essential') && workspaceId !== this.activeWorkspace) {
|
||||
await this.changeWorkspace({ uuid: workspaceId });
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user