Browse Source

fix scrolling down after message received in chat

cyberta 4 years ago
parent
commit
d60841a776
1 changed files with 2 additions and 1 deletions
  1. 2 1
      deltachat-ios/Chat/ChatViewController.swift

+ 2 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -885,10 +885,11 @@ class ChatViewController: UITableViewController {
         DispatchQueue.global(qos: .background).async { [weak self] in
             self?.dcContext.markSeenMessages(messageIds: [UInt32(message.id)])
         }
+
+        let wasLastSectionVisible = isLastRowVisible()
         messageIds.append(message.id)
         emptyStateView.isHidden = true
 
-        let wasLastSectionVisible = isLastRowVisible()
         tableView.reloadData()
         if wasLastSectionVisible || message.isFromCurrentSender {
             scrollToBottom(animated: true)