Fix crash when adding pinned statuses section during refresh
This commit is contained in:
parent
e4ff632dcb
commit
6e92633793
|
@ -196,13 +196,14 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
||||||
return (status.id, state)
|
return (status.id, state)
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if self.sections.count < 1 {
|
|
||||||
self.sections.append(pinnedStatues)
|
|
||||||
} else {
|
|
||||||
self.sections[0] = pinnedStatues
|
|
||||||
}
|
|
||||||
UIView.performWithoutAnimation {
|
UIView.performWithoutAnimation {
|
||||||
self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
|
if self.sections.count < 1 {
|
||||||
|
self.sections.append(pinnedStatues)
|
||||||
|
self.tableView.insertSections(IndexSet(integer: 0), with: .none)
|
||||||
|
} else {
|
||||||
|
self.sections[0] = pinnedStatues
|
||||||
|
self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue