forked from shadowfacts/Tusker
Fix crash when adding pinned statuses section during refresh
This commit is contained in:
parent
e4ff632dcb
commit
6e92633793
|
@ -196,12 +196,12 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
|||
return (status.id, state)
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
UIView.performWithoutAnimation {
|
||||
if self.sections.count < 1 {
|
||||
self.sections.append(pinnedStatues)
|
||||
self.tableView.insertSections(IndexSet(integer: 0), with: .none)
|
||||
} else {
|
||||
self.sections[0] = pinnedStatues
|
||||
}
|
||||
UIView.performWithoutAnimation {
|
||||
self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
|
||||
}
|
||||
}
|
||||
|
@ -209,6 +209,7 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UITableViewDatasource
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
|
|
Loading…
Reference in New Issue