feat: Take always into account that no normal window may exist when restoring, b=no-bug, c=no-component

This commit is contained in:
mr. m
2026-02-11 20:35:56 +01:00
parent 1db7e19037
commit a1e7af81cc

View File

@@ -279,14 +279,16 @@ export class nsZenSessionManager {
// to make sure that the sidebar object is properly initialized.
// This would happen on first run after having a single private window
// open when quitting the app, for example.
if (!initialState?.windows?.length) {
let normalWindowsExist = initialState?.windows?.some(
(win) => !win.isPrivate && !win.isPopup && !win.isTaskbarTab && !win.isZenUnsynced
);
if (!initialState?.windows?.length || !normalWindowsExist) {
this.log("No windows found in initial state, creating an empty one");
initialState ||= {};
initialState.windows = [
{
tabs: [],
},
];
initialState.windows ||= [];
initialState.windows.push({
tabs: [],
});
}
return initialState;
}
@@ -316,7 +318,7 @@ export class nsZenSessionManager {
this.log(`Restoring Zen session data into ${initialState.windows?.length || 0} windows`);
for (let i = 0; i < initialState.windows.length; i++) {
let winData = initialState.windows[i];
if (winData.isZenUnsynced) {
if (winData.isZenUnsynced || winData.isPrivate || winData.isPopup || winData.isTaskbarTab) {
continue;
}
this.#restoreWindowData(winData);