Преглед на файлове

don't scroll to bottom on keyboard change event if the chat was just entered. fixes initial scrolling to new messages marker instead of the bottom

cyberta преди 3 години
родител
ревизия
9930319406
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      deltachat-ios/Chat/ChatViewController.swift

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

@@ -321,12 +321,12 @@ class ChatViewController: UITableViewController {
 
         keyboardManager.on(event: .didChangeFrame) { [weak self] _ in
             guard let self = self else { return }
-            if self.isLastRowVisible() && !self.tableView.isDragging && !self.tableView.isDecelerating && self.highlightedMsg == nil {
+            if self.isLastRowVisible() && !self.tableView.isDragging && !self.tableView.isDecelerating && self.highlightedMsg == nil && !self.isInitial {
                 self.scrollToBottom()
             }
         }.on(event: .willChangeFrame) { [weak self] _ in
             guard let self = self else { return }
-            if self.isLastRowVisible() && !self.tableView.isDragging && !self.tableView.isDecelerating && self.highlightedMsg == nil {
+            if self.isLastRowVisible() && !self.tableView.isDragging && !self.tableView.isDecelerating && self.highlightedMsg == nil  && !self.isInitial {
                 self.scrollToBottom()
             }
         }