Rest the currentFeedIndexPath if it has become invalidated by a shadow table rebuild. Issue #1741

This commit is contained in:
Maurice Parker 2020-01-29 17:06:35 -07:00
parent c293bc3a12
commit fdde879910
1 changed files with 6 additions and 0 deletions

View File

@ -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 {