Fix select position getting lost on refreshes
This commit is contained in:
parent
be8c14bc65
commit
379ba49fd5
|
@ -475,10 +475,11 @@ private extension MasterTimelineViewController {
|
|||
}
|
||||
|
||||
func performBlockAndRestoreSelection(_ block: (() -> Void)) {
|
||||
let indexPaths = tableView.indexPathsForSelectedRows
|
||||
let article = coordinator.currentArticle
|
||||
block()
|
||||
indexPaths?.forEach { [weak self] indexPath in
|
||||
self?.tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
|
||||
if let articleID = article?.articleID, let index = coordinator.indexesForArticleIDs(Set([articleID])).first {
|
||||
let indexPath = IndexPath(row: index, section: 0)
|
||||
tableView.selectRow(at: indexPath, animated: false, scrollPosition: .middle)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue