Only clear Feed/Timeline selection after view begins to appear. Issue #1156

This commit is contained in:
Maurice Parker
2019-10-22 19:20:35 -05:00
parent b0881f47fc
commit 7b51a272b0
7 changed files with 33 additions and 15 deletions

View File

@@ -76,7 +76,6 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
}
override func viewWillAppear(_ animated: Bool) {
clearsSelectionOnViewWillAppear = coordinator.isRootSplitCollapsed
applyChanges(animate: false)
super.viewWillAppear(animated)
}
@@ -132,7 +131,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
func restoreSelectionIfNecessary(adjustScroll: Bool) {
if let article = coordinator.currentArticle, let indexPath = dataSource.indexPath(for: article) {
if adjustScroll {
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false, deselect: coordinator.isRootSplitCollapsed)
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false)
} else {
tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
}
@@ -150,7 +149,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
func updateArticleSelection(animated: Bool) {
if let article = coordinator.currentArticle, let indexPath = dataSource.indexPath(for: article) {
if tableView.indexPathForSelectedRow != indexPath {
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true, deselect: coordinator.isRootSplitCollapsed)
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true)
}
} else {
tableView.selectRow(at: nil, animated: animated, scrollPosition: .none)