mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix message display missing when going from a conversation with few messages (not enough to fill screen) to conversation with many messages
This commit is contained in:
parent
9094c9cea8
commit
c02dcc754e
1 changed files with 7 additions and 3 deletions
|
|
@ -113,7 +113,7 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
if ChatConversationTableViewModel.sharedModel.getNBMessages() > 0 {
|
||||
scrollToBottom(animated: false)
|
||||
scrollToBottom(animated: false, async:false)
|
||||
}
|
||||
NotificationCenter.default.removeObserver(self, name: Notification.Name("LinphoneFriendPresenceUpdate"), object: nil)
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
|
|
@ -130,8 +130,12 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
self.collectionView.scrollToItem(at: IndexPath(row: messageIndex, section: 0), at: .bottom, animated: false)
|
||||
}
|
||||
|
||||
func scrollToBottom(animated: Bool){
|
||||
DispatchQueue.main.async{
|
||||
func scrollToBottom(animated: Bool, async: Bool = true){
|
||||
if (async) {
|
||||
DispatchQueue.main.async{
|
||||
self.collectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: animated)
|
||||
}
|
||||
} else {
|
||||
self.collectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: animated)
|
||||
}
|
||||
ChatConversationViewSwift.markAsRead(ChatConversationViewModel.sharedModel.chatRoom?.getCobject)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue