From 1b143c3bd8ce76f249be7af7eb44394cdadb9331 Mon Sep 17 00:00:00 2001 From: malaow3 Date: Mon, 18 Nov 2024 04:59:40 +0000 Subject: [PATCH] Prevent empty messages from being sent --- src/ui/src/channel/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/src/channel/mod.rs b/src/ui/src/channel/mod.rs index 77370e0..62f9c1c 100644 --- a/src/ui/src/channel/mod.rs +++ b/src/ui/src/channel/mod.rs @@ -55,6 +55,9 @@ impl ChannelView { .subscribe(&message_input, move |channel_view, text_input, input_event, ctx| { if let InputEvent::PressEnter = input_event { let content = text_input.read(ctx).text().to_string(); + if content.is_empty() { + return; + } let channel_sender = channel.clone(); text_input.update(ctx, |text_input, cx| {