fix: Fixed restoring the previous pinned state clearing up the custom icon, b=no-bug, c=tabs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user