From 2c8d2babdc3be341ab433ec4a51c76010564c241 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Mon, 10 Mar 2025 01:12:10 +0100 Subject: [PATCH] Fixed removing workspaces deleting the empty tab as well --- .../base/zen-components/ZenWorkspaces.mjs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index bf9b09240..4bbbc26d3 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -1405,15 +1405,16 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } _deleteAllTabsInWorkspace(workspaceID) { - for (let tab of this.allStoredTabs) { - if (tab.getAttribute('zen-workspace-id') === workspaceID) { - gBrowser.removeTab(tab, { - animate: false, - skipSessionStore: true, - closeWindowWithLastTab: false, - }); + gBrowser.removeTabs( + Array.from(gBrowser.tabs).filter( + (tab) => tab.getAttribute('zen-workspace-id') === workspaceID && !tab.hasAttribute('zen-empty-tab') + ), + { + animate: false, + skipSessionStore: true, + closeWindowWithLastTab: false, } - } + ); } moveTabToWorkspace(tab, workspaceID) {