Skip to content

Commit

Permalink
Do not send empty messages (i.e. only spaces) (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodh authored and Jikstra committed Feb 6, 2019
1 parent 7b6685c commit d4305e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/renderer/components/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ class Composer extends React.Component {

sendMessage () {
if (!this.state.text) return this.handleError()
if (this.state.text.match(/^\s*$/)) {
log.debug(`Empty message: don't send it...`)
return
}
this.props.onSubmit({
text: this.state.text
})
Expand Down

0 comments on commit d4305e5

Please sign in to comment.