diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-08-27 11:22:19 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-08-27 11:22:19 -0400 |
commit | e1c09605dce8441e1523abc4c830062fdd457337 (patch) | |
tree | fab3563d01c1194e8dd3d873aeb37d7dd55f3b81 /web/react/components/create_comment.jsx | |
parent | ea4beb7c4545e3ad6c7214a6a15ec66cc784f5ea (diff) | |
parent | 041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (diff) | |
download | chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.gz chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.bz2 chat-e1c09605dce8441e1523abc4c830062fdd457337.zip |
Merge pull request #469 from mattermost/mm-1699
MM-1699 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.jsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 94b6e1b7f..f6e34fda9 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) { |