Clear search results when no timeline fetcher is specified

This commit is contained in:
Maurice Parker 2019-09-03 12:25:27 -05:00
parent 2a00c879f8
commit 4bce625f18
2 changed files with 5 additions and 1 deletions

View File

@ -387,6 +387,8 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
if tableView.indexPathForSelectedRow != indexPath {
tableView.selectRow(at: indexPath, animated: true, scrollPosition: .middle)
}
} else {
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
}
}

View File

@ -549,7 +549,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
func beginSearching() {
isSearching = true
searchArticleIds = Set(articles.map { $0.articleID })
timelineFetcher = nil
selectFeed(nil)
}
func endSearching() {
@ -560,6 +560,8 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
if let ip = currentMasterIndexPath, let node = nodeFor(ip), let fetcher = node.representedObject as? ArticleFetcher {
timelineFetcher = fetcher
} else {
timelineFetcher = nil
}
}