feat: Only collapse folders after pinned restore, b=no-bug, c=folders, tabs

This commit is contained in:
mr. m
2025-09-06 21:08:16 +02:00
parent 407fc98930
commit 1c5044b90d
2 changed files with 14 additions and 3 deletions

View File

@@ -875,7 +875,9 @@
// that we want it to initially be collapsed.
setTimeout(
(folder) => {
folder.collapsed = !!options.collapsed;
gZenPinnedTabManager.promiseInitializedPinned.then(() => {
folder.collapsed = !!options.collapsed;
});
},
0,
folder

View File

@@ -69,6 +69,9 @@
MAX_ESSENTIALS_TABS = 12;
#hasInitializedPins = false;
promiseInitializedPinned = new Promise((resolve) => {
this._resolvePinnedInitializedInternal = resolve;
});
async init() {
if (!this.enabled) {
@@ -187,10 +190,16 @@
return this._pinsCache;
}
#finishedInitializingPins() {
this._resolvePinnedInitializedInternal();
delete this._resolvePinnedInitializedInternal;
this.#hasInitializedPins = true;
}
async #initializePinnedTabs(init = false) {
const pins = this._pinsCache;
if (!pins?.length || !init) {
this.#hasInitializedPins = true;
this.#finishedInitializingPins();
return;
}
@@ -374,7 +383,7 @@
}
setTimeout(() => {
this.#hasInitializedPins = true;
this.#finishedInitializingPins();
}, 0);
gBrowser._updateTabBarForPinnedTabs();