浏览代码

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

cyberta 4 年之前
父节点
当前提交
298c26e305
共有 1 个文件被更改,包括 1 次插入2 次删除
  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() {