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() {
|
@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
|
|
||||||
func loadNewerAndEndRefreshing() async {
|
|
||||||
await controller.loadNewer()
|
await controller.loadNewer()
|
||||||
|
}
|
||||||
#if !targetEnvironment(macCatalyst)
|
#if !targetEnvironment(macCatalyst)
|
||||||
collectionView.refreshControl?.endRefreshing()
|
collectionView.refreshControl?.endRefreshing()
|
||||||
#endif
|
#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() {
|
private func syncAndCheckPresentIfEnoughTimeElapsed() {
|
||||||
|
|
Loading…
Reference in New Issue