summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_post.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r--web/react/components/create_post.jsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index efaa40577..73210c855 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -18,6 +18,7 @@ var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
module.exports = React.createClass({
+ displayName: 'CreatePost',
lastTime: 0,
handleSubmit: function(e) {
e.preventDefault();
@@ -82,7 +83,7 @@ module.exports = React.createClass({
client.createPost(post, channel,
function(data) {
this.resizePostHolder();
- AsyncClient.getPosts(true);
+ AsyncClient.getPosts();
var member = ChannelStore.getMember(channel.id);
member.msg_count = channel.total_msg_count;
@@ -112,8 +113,6 @@ module.exports = React.createClass({
}.bind(this)
);
}
-
- $('.post-list-holder-by-time').perfectScrollbar('update');
},
componentDidUpdate: function() {
this.resizePostHolder();
@@ -131,9 +130,12 @@ 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, 'Message length cannot exceed ' + Constants.MAX_POST_LEN + ' characters');
+
this.resizePostHolder();
- this.setState({messageText: messageText});
+ this.setState({messageText: messageText, postError: newPostError});
var draft = PostStore.getCurrentDraft();
draft['message'] = messageText;