Explorar o código

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

cyberta %!s(int64=4) %!d(string=hai) anos
pai
achega
298c26e305
Modificáronse 1 ficheiros con 1 adicións e 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() {