From 2abc5a4a1a80e9c21d046c265f6bf46a63174066 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 22 Jun 2016 12:29:03 -0400 Subject: [PATCH] Fix occasional visual hiccup when posting/replying to messages (#3397) --- webapp/components/create_comment.jsx | 7 ++++++- webapp/components/create_post.jsx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 85f8ac864d..f7564f3965 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -146,8 +146,13 @@ class CreateComment extends React.Component { GlobalActions.emitUserCommentedEvent(post); Client.createPost( post, - () => { + (data) => { PostStore.removePendingPost(post.channel_id, post.pending_post_id); + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_POST, + post: data + }); }, (err) => { if (err.id === 'api.post.create_post.root_id.app_error') { diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index eedae85714..4e88a538fe 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -179,8 +179,13 @@ class CreatePost extends React.Component { this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null}); Client.createPost(post, - () => { + (data) => { PostStore.removePendingPost(post.pending_post_id); + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_POST, + post: data + }); }, (err) => { if (err.id === 'api.post.create_post.root_id.app_error') {