refactor: Simplify new tab handling in collapsed live folders, p=#12552

This commit is contained in:
Andrey Bochkarev
2026-02-28 21:38:32 +03:00
committed by GitHub
parent 6aefade7f8
commit 9bc0a4ca92

View File

@@ -281,18 +281,10 @@ export class nsZenFolder extends MozTabbrowserTabGroup {
addTabs(tabs) {
super.addTabs(tabs);
if (this.collapsed && !gZenFolders._sessionRestoring && this.isLiveFolder && tabs.length) {
let activeTabs = this.activeTabs;
activeTabs.push(...tabs);
gZenFolders._dontAnimateFolder = true;
gZenFolders.on_TabGroupExpand({ target: this }).then(() => {
for (let tab of activeTabs) {
tabs.forEach((tab) => {
tab.setAttribute("folder-active", "true");
}
gZenFolders.on_TabGroupCollapse({ target: this }).then(() => {
delete gZenFolders._dontAnimateFolder;
gBrowser.tabContainer._invalidateCachedVisibleTabs();
});
});
gZenFolders.animateCollapse(this);
}
}