Fix Home sidebar item getting deselected immediately on load

This commit is contained in:
Shadowfacts 2021-05-06 22:02:27 -04:00
parent 2c9f00d19f
commit c34ce758dd
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 0 deletions

View File

@ -168,7 +168,13 @@ class MainSidebarViewController: UIViewController {
.profileDirectory, .profileDirectory,
], toSection: .discover) ], toSection: .discover)
} }
let prevSelected = collectionView.indexPathsForSelectedItems
dataSource.apply(snapshot, animatingDifferences: false) dataSource.apply(snapshot, animatingDifferences: false)
if let prevSelected = prevSelected?.first {
collectionView.selectItem(at: prevSelected, animated: false, scrollPosition: .top)
}
} }
private func reloadLists() { private func reloadLists() {