@@ -32,7 +32,8 @@ final class IssuesViewController:
32
32
IssueNeckLoadSectionControllerDelegate ,
33
33
FlatCacheListener ,
34
34
IssueCommentSectionControllerDelegate ,
35
- IssueTextActionsViewSendDelegate {
35
+ IssueTextActionsViewSendDelegate ,
36
+ MessageTextViewListener {
36
37
37
38
private let client : GithubClient
38
39
private let model : IssueDetailsModel
@@ -50,6 +51,7 @@ final class IssuesViewController:
50
51
51
52
private var needsScrollToBottom = false
52
53
private var lastTimelineElement : ListDiffable ?
54
+ private var actions : IssueTextActionsView ?
53
55
54
56
// must fetch collaborator info from API before showing editing controls
55
57
private var viewerIsCollaborator = false
@@ -183,6 +185,10 @@ final class IssuesViewController:
183
185
// text input bar uses UIVisualEffectView, don't try to match it
184
186
actions. backgroundColor = . clear
185
187
actions. sendDelegate = self
188
+ self . actions = actions
189
+
190
+ actions. sendButtonEnabled = !messageView. textView. text. isEmpty
191
+ messageView. textView. add ( listener: self )
186
192
187
193
textActionsController. configure ( client: client, textView: messageView. textView, actions: actions)
188
194
textActionsController. viewController = self
@@ -600,4 +606,13 @@ final class IssuesViewController:
600
606
}
601
607
}
602
608
609
+ // MARK: MessageTextViewListener
610
+
611
+ func didChange( textView: MessageTextView ) {
612
+ actions? . sendButtonEnabled = !textView. text. isEmpty
613
+ }
614
+
615
+ func didChangeSelection( textView: MessageTextView ) { }
616
+ func willChangeRange( textView: MessageTextView , to range: NSRange ) { }
617
+
603
618
}
0 commit comments