Prevent attempt to restore article selection when there are no articles
This commit is contained in:
parent
9f6203e839
commit
d0570d16a8
|
@ -156,6 +156,8 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateArticleSelection(animate: Bool) {
|
func updateArticleSelection(animate: Bool) {
|
||||||
|
guard !coordinator.articles.isEmpty else { return }
|
||||||
|
|
||||||
if let indexPath = coordinator.currentArticleIndexPath {
|
if let indexPath = coordinator.currentArticleIndexPath {
|
||||||
if tableView.indexPathForSelectedRow != indexPath {
|
if tableView.indexPathForSelectedRow != indexPath {
|
||||||
tableView.selectRow(at: indexPath, animated: animate, scrollPosition: .middle)
|
tableView.selectRow(at: indexPath, animated: animate, scrollPosition: .middle)
|
||||||
|
@ -163,6 +165,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||||
} else {
|
} else {
|
||||||
tableView.selectRow(at: nil, animated: animate, scrollPosition: .none)
|
tableView.selectRow(at: nil, animated: animate, scrollPosition: .none)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUI()
|
updateUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue