diff --git a/src/zen/sessionstore/ZenSessionManager.sys.mjs b/src/zen/sessionstore/ZenSessionManager.sys.mjs index 254d1e379..9b82ae703 100644 --- a/src/zen/sessionstore/ZenSessionManager.sys.mjs +++ b/src/zen/sessionstore/ZenSessionManager.sys.mjs @@ -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); } } diff --git a/src/zen/sessionstore/ZenWindowSync.sys.mjs b/src/zen/sessionstore/ZenWindowSync.sys.mjs index 2d8878751..c8f2dfd17 100644 --- a/src/zen/sessionstore/ZenWindowSync.sys.mjs +++ b/src/zen/sessionstore/ZenWindowSync.sys.mjs @@ -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); diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index fda9a0ebd..0e0b80110 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -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);