Ensure that the snapshot has items in it before testing section zero.
This commit is contained in:
parent
a1cb184fcb
commit
d1b8ac06af
|
@ -611,12 +611,14 @@ private extension MasterTimelineViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
tableView.selectRow(at: nil, animated: false, scrollPosition: .top)
|
tableView.selectRow(at: nil, animated: false, scrollPosition: .top)
|
||||||
if resetScroll && dataSource.snapshot().itemIdentifiers(inSection: 0).count > 0 {
|
if resetScroll {
|
||||||
tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)
|
let snapshot = dataSource.snapshot()
|
||||||
|
if snapshot.sectionIdentifiers.count > 0 && snapshot.itemIdentifiers(inSection: 0).count > 0 {
|
||||||
|
tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateToolbar()
|
updateToolbar()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateToolbar() {
|
func updateToolbar() {
|
||||||
|
|
Loading…
Reference in New Issue