mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 08:17:16 +00:00
Fix restore-selection bug on refreshing the timeline.
This commit is contained in:
1 parent
09b467f9d4
commit
c5625635de
2 files changed
+19
-12
No files matched your search
@@ -226,11 +226,10 @@ final class MainTimelineModernViewController: UIViewController, UndoableCommandR
|
||||
Self.logger.debug("MainTimelineModernViewController: restoreSelectionIfNecessary selecting item and adjusting scroll")
|
||||
collectionView.selectItemAndScrollIfNotVisible(at: indexPath, animations: [])
|
||||
} else {
|
||||
if let indexPaths = collectionView.indexPathsForSelectedItems {
|
||||
if !indexPaths.contains(indexPath) {
|
||||
Self.logger.debug("MainTimelineModernViewController: restoreSelectionIfNecessary does not contain selected index path")
|
||||
collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredVertically)
|
||||
}
|
||||
let indexPaths = collectionView.indexPathsForSelectedItems ?? []
|
||||
if !indexPaths.contains(indexPath) {
|
||||
Self.logger.debug("MainTimelineModernViewController: restoreSelectionIfNecessary does not contain selected index path")
|
||||
collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredVertically)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,6 +255,7 @@ final class MainTimelineModernViewController: UIViewController, UndoableCommandR
|
||||
func reinitializeArticles(resetScroll: Bool) {
|
||||
Self.logger.debug("MainTimelineModernViewController: reinitializeArticles")
|
||||
resetUI(resetScroll: resetScroll)
|
||||
restoreSelectionIfNecessary(adjustScroll: false)
|
||||
}
|
||||
|
||||
func reloadArticles(animated: Bool) {
|
||||
|
||||
Reference in new issue
Block a user