Don't check present when refreshing timeline
This commit is contained in:
parent
0c0180264e
commit
38ac5858a9
|
@ -718,27 +718,15 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func refresh() {
|
@objc func refresh() {
|
||||||
Task {
|
Task { @MainActor in
|
||||||
if case .notLoadedInitial = controller.state {
|
if case .notLoadedInitial = controller.state {
|
||||||
await controller.loadInitial()
|
await controller.loadInitial()
|
||||||
#if !targetEnvironment(macCatalyst)
|
|
||||||
collectionView.refreshControl?.endRefreshing()
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
@MainActor
|
await controller.loadNewer()
|
||||||
func loadNewerAndEndRefreshing() async {
|
|
||||||
await controller.loadNewer()
|
|
||||||
#if !targetEnvironment(macCatalyst)
|
|
||||||
collectionView.refreshControl?.endRefreshing()
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// I'm not sure whether this should move into TimelineLikeController/TimelineLikeCollectionViewController
|
|
||||||
let (_, presentItems) = await (loadNewerAndEndRefreshing(), try? loadInitial())
|
|
||||||
if let presentItems, !presentItems.isEmpty {
|
|
||||||
insertPresentItemsAndShowJumpToast(presentItems)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#if !targetEnvironment(macCatalyst)
|
||||||
|
collectionView.refreshControl?.endRefreshing()
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue