Skip to content

Commit

Permalink
Fixed handleMessageSubmit to avoid whitespaces as userInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian30 committed Jan 30, 2019
1 parent c62f69f commit 9e44bae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Widget extends Component {
handleMessageSubmit = (event) => {
event.preventDefault();
const userInput = event.target.message.value;
if (userInput) {
if (userInput.trim()) {
this.props.dispatch(addUserMessage(userInput));
this.props.handleNewUserMessage(userInput);
}
Expand Down

0 comments on commit 9e44bae

Please sign in to comment.