Fix list timeline refresh failing if initial load returned no statuses

This commit is contained in:
Shadowfacts 2023-10-28 13:36:11 -05:00
parent bd21e88e8b
commit 0de9a9fd37
1 changed files with 4 additions and 3 deletions

View File

@ -726,10 +726,11 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
@objc func refresh() {
Task { @MainActor in
if case .notLoadedInitial = controller.state {
await controller.loadInitial()
} else {
if case .idle = controller.state,
!dataSource.snapshot().itemIdentifiers(inSection: .statuses).isEmpty {
await controller.loadNewer()
} else {
await controller.loadInitial()
}
#if !targetEnvironment(macCatalyst)
collectionView.refreshControl?.endRefreshing()