fix: Fixed restoring the previous pinned state clearing up the custom icon, b=no-bug, c=tabs

This commit is contained in:
mr. m
2025-12-28 14:58:35 +01:00
parent 1338b43e10
commit 32a9267af2
3 changed files with 5 additions and 4 deletions

View File

@@ -224,6 +224,7 @@ export class nsZenSessionManager {
// If there's no initial state, nothing to restore. This would
// happen if the file is empty or corrupted.
if (!initialState) {
this.log('No initial state to restore!');
return;
}
// If there are no windows, we create an empty one. By default,
@@ -249,7 +250,7 @@ export class nsZenSessionManager {
// guarantee that all tabs, groups, folders and split view data
// are properly synced across all windows.
this.log(`Restoring Zen session data into ${initialState.windows?.length || 0} windows`);
for (const winData of initialState.windows || []) {
for (const winData of initialState.windows) {
this.#restoreWindowData(winData);
}
}

View File

@@ -176,8 +176,8 @@ class nsZenWindowSync {
// This should only happen really when updating from an older version
// that didn't have this feature.
this.#runOnAllWindows(null, (aWindow) => {
const { gBrowser } = aWindow;
for (let tab of gBrowser.tabs) {
const { gZenWorkspaces } = aWindow;
for (let tab of gZenWorkspaces.allStoredTabs) {
if (!tab.id) {
tab.id = this.#newTabSyncId;
lazy.TabStateFlusher.flush(tab.linkedBrowser);

View File

@@ -326,7 +326,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
// Remove everything except the entry we want to keep
state.entries = [initialState.entry];
state.image = initialState.image;
state.image = tab.zenStaticIcon || initialState.image;
state.index = 0;
SessionStore.setTabState(tab, state);