Browse Source

add short comment and fix debugging output

cyberta 2 năm trước cách đây
mục cha
commit
e1daa8b706
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      deltachat-ios/Chat/ChatViewController.swift

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

@@ -2451,9 +2451,10 @@ extension ChatViewController: AudioControllerDelegate {
 extension ChatViewController: UITextViewDelegate {
     func textViewShouldEndEditing(_ textView: UITextView) -> Bool {
         if keepKeyboard.get() {
+            // the event is triggered twice on some devices, we're debouncing this
             logger.debug(">>>>> textViewShouldEndEditing - keep keyboard")
             let now = Double(Date().timeIntervalSince1970)
-            logger.debug(">>>> debounce time: \(lastTextViewShouldEndEditingUpdate - now)")
+            logger.debug(">>>> debounce time: \(now - lastTextViewShouldEndEditingUpdate)")
             if now - lastTextViewShouldEndEditingUpdate < 0.5 {
                 return false
             }