From 0de9a9fd371169433e980e0d09f00008429e1130 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 28 Oct 2023 13:36:11 -0500 Subject: [PATCH] Fix list timeline refresh failing if initial load returned no statuses --- Tusker/Screens/Timeline/TimelineViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index e8096cf4..2f7ec098 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -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()