diff --git a/Tusker/Screens/Notifications/NotificationsTableViewController.swift b/Tusker/Screens/Notifications/NotificationsTableViewController.swift index c68ac440..0bd72ca5 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 ecf12bfd..f969d781 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 c5096da3..f7321f38 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()