mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix select position getting lost on refreshes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user