summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_comment.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/create_comment.jsx')
-rw-r--r--web/react/components/create_comment.jsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index 1de768872..94b6e1b7f 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -105,14 +105,17 @@ module.exports = React.createClass({
this.lastTime = t;
}
},
- handleUserInput: function(messageText) {
+ handleUserInput: function(message) {
+ var messageText = utils.truncateText(message);
+ var newPostError = utils.checkMessageLengthError(messageText, this.state.postError, 'Comment length cannot exceed ' + Constants.MAX_POST_LEN + ' characters');
+
var draft = PostStore.getCommentDraft(this.props.rootId);
draft.message = messageText;
PostStore.storeCommentDraft(this.props.rootId, draft);
$('.post-right__scroll').scrollTop($('.post-right__scroll')[0].scrollHeight);
$('.post-right__scroll').perfectScrollbar('update');
- this.setState({messageText: messageText});
+ this.setState({messageText: messageText, postError: newPostError});
},
handleUploadStart: function(clientIds, channelId) {
var draft = PostStore.getCommentDraft(this.props.rootId);