forked from shadowfacts/Tusker
parent
d7aa3f1617
commit
27b39b79e6
|
@ -98,7 +98,9 @@ class NotificationsTableViewController: TimelineLikeTableViewController<Notifica
|
|||
mastodonController.run(request) { (response) in
|
||||
guard case let .success(newNotifications, pagination) = response else { fatalError() }
|
||||
|
||||
self.newer = pagination?.newer
|
||||
if let newer = pagination?.newer {
|
||||
self.newer = newer
|
||||
}
|
||||
|
||||
let groups = NotificationGroup.createGroups(notifications: newNotifications, only: self.groupTypes)
|
||||
|
||||
|
|
|
@ -145,7 +145,9 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
|||
return
|
||||
}
|
||||
|
||||
self.newer = pagination?.newer
|
||||
if let newer = pagination?.newer {
|
||||
self.newer = newer
|
||||
}
|
||||
|
||||
self.mastodonController.persistentContainer.addAll(statuses: statuses) {
|
||||
completion(statuses.map { ($0.id, .unknown) })
|
||||
|
|
|
@ -113,7 +113,11 @@ class TimelineTableViewController: TimelineLikeTableViewController<TimelineEntry
|
|||
mastodonController.run(request) { (response) in
|
||||
guard case let .success(statuses, pagination) = response else { fatalError() }
|
||||
|
||||
self.newer = pagination?.newer
|
||||
// if there are no new statuses, pagination is nil
|
||||
// if we were to then overwrite self.newer, future refreshes would fail
|
||||
if let newer = pagination?.newer {
|
||||
self.newer = newer
|
||||
}
|
||||
|
||||
self.mastodonController?.persistentContainer.addAll(statuses: statuses) {
|
||||
completion(statuses.map { ($0.id, .unknown) })
|
||||
|
|
Loading…
Reference in New Issue