summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-06-22 12:29:03 -0400
committerChristopher Speller <crspeller@gmail.com>2016-06-22 12:29:03 -0400
commit2abc5a4a1a80e9c21d046c265f6bf46a63174066 (patch)
treefa0815eb7d2f9a89c0109a44f1b58f94484e8e85
parent14510ce19470c176a7f286d4a3238e813f7dc959 (diff)
downloadchat-2abc5a4a1a80e9c21d046c265f6bf46a63174066.tar.gz
chat-2abc5a4a1a80e9c21d046c265f6bf46a63174066.tar.bz2
chat-2abc5a4a1a80e9c21d046c265f6bf46a63174066.zip
Fix occasional visual hiccup when posting/replying to messages (#3397)
-rw-r--r--webapp/components/create_comment.jsx7
-rw-r--r--webapp/components/create_post.jsx7
2 files changed, 12 insertions, 2 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx
index 85f8ac864..f7564f396 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 eedae8571..4e88a538f 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') {