From fdde879910f70401a8ac2a3b625c16a6b6f008d9 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 29 Jan 2020 17:06:35 -0700 Subject: [PATCH] Rest the currentFeedIndexPath if it has become invalidated by a shadow table rebuild. Issue #1741 --- iOS/SceneCoordinator.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 11833219e..12905512d 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -133,6 +133,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { return treeController.rootNode } + // At some point we should refactor the current Feed IndexPath out and only use the timeline feed private(set) var currentFeedIndexPath: IndexPath? var timelineIconImage: IconImage? { @@ -1322,6 +1323,11 @@ private extension SceneCoordinator { shadowTable.append(result) } + + // If we have a current Feed IndexPath it is no longer valid and needs reset. + if currentFeedIndexPath != nil { + currentFeedIndexPath = indexPathFor(timelineFeed as AnyObject) + } } func shadowTableContains(_ feed: Feed) -> Bool {