From d68106ac0b752cf6cf75acb5b1af5aac24546bbd Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 1 Dec 2025 10:34:34 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20bug=20restoring=20expansion=20state=20on?= =?UTF-8?q?=20launch.=20Don=E2=80=99t=20overwrite=20stored=20state=20on=20?= =?UTF-8?q?launch=20=E2=80=94=C2=A0write=20state=20only=20when=20user=20ma?= =?UTF-8?q?kes=20change.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/SceneCoordinator.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index f426d7403..8350ccf3f 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -716,6 +716,7 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner { func expand(_ containerID: ContainerIdentifier) { markExpanded(containerID) rebuildBackingStores() + saveExpandedTableToUserDefaults() } /// This is a special function that expects the caller to change the disclosure arrow state outside this function. @@ -736,12 +737,14 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner { } } rebuildBackingStores() + saveExpandedTableToUserDefaults() } func collapse(_ containerID: ContainerIdentifier) { unmarkExpanded(containerID) rebuildBackingStores() clearTimelineIfNoLongerAvailable() + saveExpandedTableToUserDefaults() } /// This is a special function that expects the caller to change the disclosure arrow state outside this function. @@ -762,6 +765,7 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner { } rebuildBackingStores() clearTimelineIfNoLongerAvailable() + saveExpandedTableToUserDefaults() } func mainFeedIndexPathForCurrentTimeline() -> IndexPath? { @@ -1692,7 +1696,6 @@ private extension SceneCoordinator { func markExpanded(_ containerID: ContainerIdentifier) { expandedTable.insert(containerID) - saveExpandedTableToUserDefaults() } func markExpanded(_ containerIdentifiable: ContainerIdentifiable) { @@ -1709,7 +1712,6 @@ private extension SceneCoordinator { func unmarkExpanded(_ containerID: ContainerIdentifier) { expandedTable.remove(containerID) - saveExpandedTableToUserDefaults() } func unmarkExpanded(_ containerIdentifiable: ContainerIdentifiable) {