Fix bug restoring expansion state on launch. Don’t overwrite stored state on launch — write state only when user makes change.

This commit is contained in:
Brent Simmons committed 2025-12-01 10:34:34 -08:00
1 parent d30c627577
commit d68106ac0b
1 file changed
+4 -2
+4 -2
View File
@@ -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) {