Explorar el Código

minor refactoring, use draft objects canSend() method to evaluate send button state

cyberta hace 4 años
padre
commit
298c26e305
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      deltachat-ios/Chat/ChatViewController.swift

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

@@ -636,8 +636,7 @@ class ChatViewController: UITableViewController {
     }
 
     func evaluateInputBar(draft: DraftModel) {
-        let isEnabled = !(draft.draftText?.isEmpty ?? true) || draft.draftAttachment != nil
-        messageInputBar.sendButton.isEnabled = isEnabled
+        messageInputBar.sendButton.isEnabled = draft.canSend()
     }
 
     private func configureInputBarItems() {