Fix list timeline refresh failing if initial load returned no statuses
This commit is contained in:
parent
bd21e88e8b
commit
0de9a9fd37
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue