1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-10 04:25:31 +02:00

Fixed changing workspaces with container specific essentials turned on

This commit is contained in:
mr. M 2025-02-18 21:05:54 +01:00
parent 7e897c2a72
commit ceb0e97610
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
2 changed files with 11 additions and 1 deletions

View file

@ -1583,13 +1583,22 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
_processTabVisibility(workspaceUuid, containerId, workspaces) {
const hiddenTabs = [];
const visibleTabs = gBrowser.tabContainer.visibleTabs;
for (const tab of gBrowser.tabs) {
if (!this._shouldShowTab(tab, workspaceUuid, containerId, workspaces)) {
gBrowser.hideTab(tab, undefined, true);
hiddenTabs.push(tab);
} else if (tab.hasAttribute('zen-essential')) {
gBrowser.showTab(tab, undefined, true);
}
}
// If there's no more visible tabs, make a new tab visible
if (hiddenTabs.length === visibleTabs.length) {
this._createNewTabForWorkspace({ uuid: workspaceUuid });
}
for (const tab of hiddenTabs) {
gBrowser.hideTab(tab, undefined, true);
}
}
_shouldShowTab(tab, workspaceUuid, containerId, workspaces) {