summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_comment.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-08-26 12:09:01 -0400
committerJoramWilander <jwawilander@gmail.com>2015-08-27 08:21:26 -0400
commit041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (patch)
tree37cc2ca9252b45f6f30ba4e88037a67a700ec0ad /web/react/components/create_comment.jsx
parent8356e25f80bbba3040ceeda5732b8843b8e493c1 (diff)
downloadchat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.gz
chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.bz2
chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.zip
Refactored post handling/updating on both the client and server.
Diffstat (limited to 'web/react/components/create_comment.jsx')
-rw-r--r--web/react/components/create_comment.jsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index 1de768872..c2b7e222f 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -29,8 +29,6 @@ module.exports = React.createClass({
return;
}
- this.setState({submitting: true, serverError: null});
-
var post = {};
post.filenames = [];
post.message = this.state.messageText;
@@ -57,11 +55,10 @@ module.exports = React.createClass({
PostStore.storePendingPost(post);
PostStore.storeCommentDraft(this.props.rootId, null);
- this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
client.createPost(post, ChannelStore.getCurrent(),
function(data) {
- AsyncClient.getPosts(true, this.props.channelId);
+ AsyncClient.getPosts(this.props.channelId);
var channel = ChannelStore.get(this.props.channelId);
var member = ChannelStore.getMember(this.props.channelId);
@@ -91,6 +88,8 @@ module.exports = React.createClass({
this.setState(state);
}.bind(this)
);
+
+ this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
},
commentMsgKeyPress: function(e) {
if (e.which === 13 && !e.shiftKey && !e.altKey) {