diff --git a/core/features/Chat/Views/ChatMessagesView.swift b/core/features/Chat/Views/ChatMessagesView.swift index 8fd07c7..dd9f2a2 100644 --- a/core/features/Chat/Views/ChatMessagesView.swift +++ b/core/features/Chat/Views/ChatMessagesView.swift @@ -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() }