Bug 1954488: Delete removeAfterRestore property from savedGroups if the session is being quit for the second time r=dwalker,sthompson,sessionstore-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D241978
This commit is contained in:
Jeremy Swinarton
2025-03-18 20:48:58 +00:00
parent 4bec852b57
commit 92c3e82bc9
2 changed files with 82 additions and 0 deletions

View File

@@ -7002,6 +7002,17 @@ var SessionStoreInternal = {
};
state.selectedWindow = state.selectedWindow || 1;
// Fixes bug1954488
// This solves a case where a user had open tab groups and then quit and
// restarted the browser at least twice. In this case the saved groups
// would still be marked as removeAfterRestore groups even though there was
// no longer an open group associated with them in the lastSessionState.
// To fix this we clear this property if we see it on saved groups,
// converting them into permanently saved groups.
for (let group of defaultState.savedGroups) {
delete group.removeAfterRestore;
}
// Look at each window, remove pinned tabs, adjust selectedindex,
// remove window if necessary.
for (let wIndex = 0; wIndex < state.windows.length; ) {