Don't check present when refreshing timeline
This commit is contained in:
parent
0c0180264e
commit
38ac5858a9
|
@ -718,28 +718,16 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
|
|||
}
|
||||
|
||||
@objc func refresh() {
|
||||
Task {
|
||||
Task { @MainActor in
|
||||
if case .notLoadedInitial = controller.state {
|
||||
await controller.loadInitial()
|
||||
#if !targetEnvironment(macCatalyst)
|
||||
collectionView.refreshControl?.endRefreshing()
|
||||
#endif
|
||||
} else {
|
||||
@MainActor
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func syncAndCheckPresentIfEnoughTimeElapsed() {
|
||||
|
|
Loading…
Reference in New Issue