diff --git a/Tusker/Screens/Notifications/NotificationsTableViewController.swift b/Tusker/Screens/Notifications/NotificationsTableViewController.swift index c68ac440c1..0bd72ca57c 100644 --- a/Tusker/Screens/Notifications/NotificationsTableViewController.swift +++ b/Tusker/Screens/Notifications/NotificationsTableViewController.swift @@ -208,8 +208,10 @@ class NotificationsTableViewController: EnhancedTableViewController { MastodonCache.addAll(statuses: newNotifications.compactMap { $0.status }) MastodonCache.addAll(accounts: newNotifications.map { $0.account }) - self.newer = pagination?.newer - + if let newer = pagination?.newer { + self.newer = newer + } + DispatchQueue.main.async { self.refreshControl?.endRefreshing() diff --git a/Tusker/Screens/Profile/ProfileTableViewController.swift b/Tusker/Screens/Profile/ProfileTableViewController.swift index ecf12bfd71..f969d7817a 100644 --- a/Tusker/Screens/Profile/ProfileTableViewController.swift +++ b/Tusker/Screens/Profile/ProfileTableViewController.swift @@ -218,7 +218,9 @@ class ProfileTableViewController: EnhancedTableViewController { MastodonCache.addAll(statuses: newStatuses) self.timelineSegments[0].insert(contentsOf: newStatuses.map { ($0.id, .unknown) }, at: 0) - self.newer = pagination?.newer + if let newer = pagination?.newer { + self.newer = newer + } DispatchQueue.main.async { self.refreshControl?.endRefreshing() diff --git a/Tusker/Screens/Timeline/TimelineTableViewController.swift b/Tusker/Screens/Timeline/TimelineTableViewController.swift index c5096da3f2..f7321f38df 100644 --- a/Tusker/Screens/Timeline/TimelineTableViewController.swift +++ b/Tusker/Screens/Timeline/TimelineTableViewController.swift @@ -127,9 +127,14 @@ class TimelineTableViewController: EnhancedTableViewController { let request = MastodonController.client.getStatuses(timeline: timeline, range: newer) MastodonController.client.run(request) { response in guard case let .success(newStatuses, pagination) = response else { fatalError() } - self.newer = pagination?.newer + MastodonCache.addAll(statuses: newStatuses) self.timelineSegments[0].insert(contentsOf: newStatuses.map { ($0.id, .unknown) }, at: 0) + + if let newer = pagination?.newer { + self.newer = newer + } + DispatchQueue.main.async { self.refreshControl?.endRefreshing()