forked from shadowfacts/Tusker
parent
bb86e1aafd
commit
53702a8324
|
@ -226,6 +226,24 @@ class ProfileTableViewController: EnhancedTableViewController {
|
|||
self.refreshControl?.endRefreshing()
|
||||
}
|
||||
}
|
||||
|
||||
getStatuses(onlyPinned: true) { (response) in
|
||||
guard case let .success(newPinnedStatuses, _) = response else { fatalError() }
|
||||
MastodonCache.addAll(statuses: newPinnedStatuses)
|
||||
|
||||
let oldPinnedStatuses = self.pinnedStatuses
|
||||
var pinnedStatuses = [(id: String, state: StatusState)]()
|
||||
for status in newPinnedStatuses {
|
||||
let state: StatusState
|
||||
if let (_, oldState) = oldPinnedStatuses.first(where: { $0.id == status.id }) {
|
||||
state = oldState
|
||||
} else {
|
||||
state = .unknown
|
||||
}
|
||||
pinnedStatuses.append((status.id, state))
|
||||
}
|
||||
self.pinnedStatuses = pinnedStatuses
|
||||
}
|
||||
}
|
||||
|
||||
@objc func composePressed(_ sender: Any) {
|
||||
|
|
Loading…
Reference in New Issue