Skip to content

Commit

Permalink
Trim chat messages before sending (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick authored Apr 10, 2024
1 parent 066ed82 commit de366cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ impl ChatWindow {
result
}
{
state.core.chat_message_sent(&ch.name, &self.chat_input);
let trimmed_message = self.chat_input.trim();
if !trimmed_message.is_empty() {
state.core.chat_message_sent(&ch.name, trimmed_message);
}
self.chat_input.clear();
response.request_focus();
}
Expand Down

0 comments on commit de366cf

Please sign in to comment.