mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-20 14:33:04 +01:00
Prevent selecting of items that may not show the current article selection as is done on the iPhone
This commit is contained in:
parent
3b31a4f21d
commit
86a302f787
@ -475,9 +475,16 @@ private extension MasterTimelineViewController {
|
||||
}
|
||||
|
||||
func performBlockAndRestoreSelection(_ block: (() -> Void)) {
|
||||
let article = coordinator.currentArticle
|
||||
let articleID: String? = {
|
||||
if let indexPath = tableView.indexPathForSelectedRow, indexPath.row < coordinator.articles.count {
|
||||
return coordinator.articles[indexPath.row].articleID
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
block()
|
||||
if let articleID = article?.articleID, let index = coordinator.indexesForArticleIDs(Set([articleID])).first {
|
||||
|
||||
if let articleID = articleID, let index = coordinator.indexesForArticleIDs(Set([articleID])).first {
|
||||
let indexPath = IndexPath(row: index, section: 0)
|
||||
tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user