From 6e27399e107d494dd14de4e97c54e4adf5a52bdd Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 18 Jun 2020 22:39:04 -0400 Subject: [PATCH] Fix loading additional statuses on profiles not working This was a regression introduced in d27bddb2caf9e22bb7adad065f356aba13d5e542 which removed the didSet handlers which called reloadData on the pinnedStatuses/timelineSegments property without adding the appropriate insertRows calls where they were modified. --- .../Profile/ProfileTableViewController.swift | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Tusker/Screens/Profile/ProfileTableViewController.swift b/Tusker/Screens/Profile/ProfileTableViewController.swift index c1dd5c61..36a9976b 100644 --- a/Tusker/Screens/Profile/ProfileTableViewController.swift +++ b/Tusker/Screens/Profile/ProfileTableViewController.swift @@ -209,9 +209,16 @@ class ProfileTableViewController: EnhancedTableViewController { guard case let .success(newStatuses, pagination) = response else { fatalError() } self.mastodonController.persistentContainer.addAll(statuses: newStatuses) { - self.timelineSegments[indexPath.section - 2].append(contentsOf: newStatuses.map { ($0.id, .unknown) }) - self.older = pagination?.older + + DispatchQueue.main.async { + let start = self.timelineSegments[indexPath.section - 2].count + let indexPaths = (0..