mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-03 04:17:44 +01:00
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…
x
Reference in New Issue
Block a user