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() {
|
@objc func refresh() {
|
||||||
Task { @MainActor in
|
Task { @MainActor in
|
||||||
if case .notLoadedInitial = controller.state {
|
if case .idle = controller.state,
|
||||||
await controller.loadInitial()
|
!dataSource.snapshot().itemIdentifiers(inSection: .statuses).isEmpty {
|
||||||
} else {
|
|
||||||
await controller.loadNewer()
|
await controller.loadNewer()
|
||||||
|
} else {
|
||||||
|
await controller.loadInitial()
|
||||||
}
|
}
|
||||||
#if !targetEnvironment(macCatalyst)
|
#if !targetEnvironment(macCatalyst)
|
||||||
collectionView.refreshControl?.endRefreshing()
|
collectionView.refreshControl?.endRefreshing()
|
||||||
|
|
Loading…
Reference in New Issue