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)
|
return (status.id, state)
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
UIView.performWithoutAnimation {
|
||||||
if self.sections.count < 1 {
|
if self.sections.count < 1 {
|
||||||
self.sections.append(pinnedStatues)
|
self.sections.append(pinnedStatues)
|
||||||
|
self.tableView.insertSections(IndexSet(integer: 0), with: .none)
|
||||||
} else {
|
} else {
|
||||||
self.sections[0] = pinnedStatues
|
self.sections[0] = pinnedStatues
|
||||||
}
|
|
||||||
UIView.performWithoutAnimation {
|
|
||||||
self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
|
self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,6 +209,7 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - UITableViewDatasource
|
// MARK: - UITableViewDatasource
|
||||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
|
|
Loading…
Reference in New Issue