Skip to content

Commit

Permalink
fix(ChatMessagesView): do not allow empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfroeller committed Jun 12, 2024
1 parent b684eab commit ce49f19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/features/Chat/Views/ChatMessagesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,15 @@ struct MessageInputView: View {
TextField("Type your message", text: $messageText)
.textFieldStyle(.roundedBorder)
Button(action: {
sendMessage(messageText)
messageText = ""
if !messageText.isEmpty {
sendMessage(messageText)
messageText = ""
}
}) {
Text("Send")
}.buttonStyle(.borderedProminent)
}
.buttonStyle(.borderedProminent)
.disabled(messageText.isEmpty)
}
.padding()
}
Expand Down

0 comments on commit ce49f19

Please sign in to comment.