Fix so that we don't try to scroll before the datasource has been fully applied to the table. Issue #1463

This commit is contained in:
Maurice Parker 2019-12-24 17:34:47 -07:00
parent 5eac0dc0b4
commit 61370dd04d

View File

@ -74,11 +74,12 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
}
resetUI(resetScroll: true)
applyChanges(animated: false)
// Restore the scroll position if we have one stored
if let restoreIndexPath = coordinator.timelineMiddleIndexPath {
tableView.scrollToRow(at: restoreIndexPath, at: .middle, animated: false)
// Load the table and then scroll to the saved position if available
applyChanges(animated: false) {
if let restoreIndexPath = self.coordinator.timelineMiddleIndexPath {
self.tableView.scrollToRow(at: restoreIndexPath, at: .middle, animated: false)
}
}
}