From 4f48514d1a901c1d8100dbc9d936a8d1a549066c Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 8 Dec 2022 20:15:12 -0500 Subject: [PATCH] Actually only restore existing statuses --- Tusker/Screens/Timeline/TimelineViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index 01ad78dfa1..6b215429fa 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -315,11 +315,11 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro controller.restoreInitial { var snapshot = dataSource.snapshot() snapshot.appendSections([.statuses]) - let items = statusIDs.map { Item.status(id: $0, collapseState: .unknown, filterState: .unknown) } + let items = existingStatuses.map { Item.status(id: $0, collapseState: .unknown, filterState: .unknown) } snapshot.appendItems(items, toSection: .statuses) dataSource.apply(snapshot, animatingDifferences: false) { if let centerID = activity.userInfo?["centerID"] as? String ?? activity.userInfo?["topID"] as? String, - let index = statusIDs.firstIndex(of: centerID), + let index = existingStatuses.firstIndex(of: centerID), let indexPath = self.dataSource.indexPath(for: items[index]) { // it sometimes takes multiple attempts to convert on the right scroll position // since we're dealing with a bunch of unmeasured cells, so just try a few times in a loop