From d4147c1315517c54cef3c6fceb093f100863b40d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 22 Jul 2015 13:15:12 +0100 Subject: [PATCH] Don't allow blank messages to be sent. --- src/controllers/molecules/MessageComposer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/molecules/MessageComposer.js b/src/controllers/molecules/MessageComposer.js index c73e9f25c..74e47fcd8 100644 --- a/src/controllers/molecules/MessageComposer.js +++ b/src/controllers/molecules/MessageComposer.js @@ -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) {