diff --git a/Tusker/Screens/Profile/ProfileStatusesViewController.swift b/Tusker/Screens/Profile/ProfileStatusesViewController.swift index de377ebd..4a6d49e8 100644 --- a/Tusker/Screens/Profile/ProfileStatusesViewController.swift +++ b/Tusker/Screens/Profile/ProfileStatusesViewController.swift @@ -222,7 +222,17 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie } var snapshot = dataSource.snapshot() - let items = statuses.map { Item.status(id: $0.id, state: .unknown, pinned: true) } + let existingPinned = snapshot.itemIdentifiers(inSection: .pinned) + let items = statuses.map { + let item = Item.status(id: $0.id, state: .unknown, pinned: true) + // try to keep the existing status state + if let existing = existingPinned.first(where: { $0 == item }) { + return existing + } else { + return item + } + } + snapshot.deleteItems(snapshot.itemIdentifiers(inSection: .pinned)) snapshot.appendItems(items, toSection: .pinned) await apply(snapshot, animatingDifferences: true) }