Fixed a minor animation glitch

pull/672/head
Morgan Pretty 3 years ago
parent c33b555c3c
commit 5bf3c2d35d

@ -622,15 +622,19 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
}
private func handleInteractionUpdates(_ updatedData: [ConversationViewModel.SectionModel], initialLoad: Bool = false) {
// Ensure the first load or a load when returning from a child screen runs without animations (if
// we don't do this the cells will animate in from a frame of CGRect.zero or have a buggy transition)
// Ensure the first load or a load when returning from a child screen runs without
// animations (if we don't do this the cells will animate in from a frame of
// CGRect.zero or have a buggy transition)
guard self.hasLoadedInitialInteractionData else {
self.hasLoadedInitialInteractionData = true
self.viewModel.updateInteractionData(updatedData)
UIView.performWithoutAnimation {
self.tableView.reloadData()
self.performInitialScrollIfNeeded()
// Need to dispatch async to prevent this from causing glitches in the push animation
DispatchQueue.main.async {
self.hasLoadedInitialInteractionData = true
self.viewModel.updateInteractionData(updatedData)
UIView.performWithoutAnimation {
self.tableView.reloadData()
self.performInitialScrollIfNeeded()
}
}
return
}

Loading…
Cancel
Save