From a25ae8fed2b72f88b6ba5a9a0a6110fab085470c Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 14 Nov 2016 07:38:05 -0500 Subject: Off screen edited posts no longer show up as new posts (#4485) --- webapp/stores/post_store.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index a4e49fc98..fbe5cd457 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -245,7 +245,7 @@ class PostStoreClass extends EventEmitter { this.postsInfo[id].postList = combinedPosts; } - storePost(post) { + storePost(post, isNewPost = false) { const postList = makePostListNonNull(this.getAllPosts(post.channel_id)); if (post.pending_post_id !== '') { @@ -255,7 +255,7 @@ class PostStoreClass extends EventEmitter { post.pending_post_id = ''; postList.posts[post.id] = post; - if (postList.order.indexOf(post.id) === -1) { + if (isNewPost && postList.order.indexOf(post.id) === -1) { postList.order.unshift(post.id); } @@ -629,7 +629,7 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => { PostStore.emitChange(); break; case ActionTypes.RECEIVED_POST: - PostStore.storePost(action.post); + PostStore.storePost(action.post, true); PostStore.emitChange(); break; case ActionTypes.RECEIVED_EDIT_POST: -- cgit v1.2.3-1-g7c22