From 8997a2499661647fb49fd9c79bad9575809ce191 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sun, 25 Jan 2026 18:07:25 +0100 Subject: [PATCH] fix: Fixed migration not working for previous states, b=bug #11994, c=no-component --- src/zen/sessionstore/ZenSessionManager.sys.mjs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/zen/sessionstore/ZenSessionManager.sys.mjs b/src/zen/sessionstore/ZenSessionManager.sys.mjs index a559ccf2a..aeed984ca 100644 --- a/src/zen/sessionstore/ZenSessionManager.sys.mjs +++ b/src/zen/sessionstore/ZenSessionManager.sys.mjs @@ -301,11 +301,14 @@ export class nsZenSessionManager { } if (!initialState?.windows?.length) { initialState ||= {}; - initialState.windows = [ - { - tabs: [], - }, - ]; + let lastSessionState = initialState.lastSessionState || {}; + initialState.windows = lastSessionState.windows?.length + ? [...lastSessionState.windows] + : [ + { + tabs: [], + }, + ]; } for (const winData of initialState?.windows || []) { winData.spaces = this._migrationData?.spaces || [];