Don't allow blank messages to be sent.

pull/2/head
Kegan Dougal 2015-07-22 13:15:12 +01:00
parent 7e42072952
commit d4147c1315
1 changed files with 6 additions and 1 deletions

View File

@ -153,7 +153,12 @@ module.exports = {
onKeyDown: function (ev) {
if (ev.keyCode === KeyCode.ENTER) {
this.sentHistory.push(this.refs.textarea.getDOMNode().value);
var input = this.refs.textarea.getDOMNode().value;
if (input.length === 0) {
ev.preventDefault();
return;
}
this.sentHistory.push(input);
this.onEnter(ev);
}
else if (ev.keyCode === KeyCode.TAB) {