fix(chat): prevent empty messages
This commit is contained in:
parent
c737d46d90
commit
81d4f694b7
|
@ -157,11 +157,15 @@ class ChatInput extends Component<Props, State> {
|
|||
&& event.shiftKey === false) {
|
||||
event.preventDefault();
|
||||
|
||||
this.props.dispatch(sendMessage(this.state.message));
|
||||
const trimmed = this.state.message.trim();
|
||||
|
||||
if (trimmed) {
|
||||
this.props.dispatch(sendMessage(trimmed));
|
||||
|
||||
this.setState({ message: '' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_onMessageChange: (Object) => void;
|
||||
|
||||
|
|
Loading…
Reference in New Issue