diff --git a/Tusker/Screens/Profile/ProfileStatusesViewController.swift b/Tusker/Screens/Profile/ProfileStatusesViewController.swift index 99a38341..5eb3ad88 100644 --- a/Tusker/Screens/Profile/ProfileStatusesViewController.swift +++ b/Tusker/Screens/Profile/ProfileStatusesViewController.swift @@ -100,7 +100,7 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie } case .loading: break - case .loaded, .addedHeader: + case .loaded, .setupInitialSnapshot: var snapshot = dataSource.snapshot() snapshot.reconfigureItems([.header(id)]) dataSource.apply(snapshot, animatingDifferences: true) @@ -183,7 +183,7 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie snapshot.appendItems([.header(accountID)], toSection: .header) await apply(snapshot, animatingDifferences: false) - state = .addedHeader + state = .setupInitialSnapshot await controller.loadInitial() await tryLoadPinned() @@ -225,6 +225,12 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie } @objc func refresh() { + guard case .loaded = state else { + #if !targetEnvironment(macCatalyst) + collectionView.refreshControl?.endRefreshing() + #endif + return + } Task { // TODO: coalesce these data source updates // TODO: refresh profile @@ -242,7 +248,7 @@ extension ProfileStatusesViewController { enum State { case unloaded case loading - case addedHeader + case setupInitialSnapshot case loaded } }