diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-11-14 07:38:05 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-11-14 07:38:05 -0500 |
commit | a25ae8fed2b72f88b6ba5a9a0a6110fab085470c (patch) | |
tree | f7873d726ad85d183c9bcd9fdcf0da43370be375 /webapp/stores/post_store.jsx | |
parent | 602f85d2efe6b9127c0cd79618757c3ff2b0ef5b (diff) | |
download | chat-a25ae8fed2b72f88b6ba5a9a0a6110fab085470c.tar.gz chat-a25ae8fed2b72f88b6ba5a9a0a6110fab085470c.tar.bz2 chat-a25ae8fed2b72f88b6ba5a9a0a6110fab085470c.zip |
Off screen edited posts no longer show up as new posts (#4485)
Diffstat (limited to 'webapp/stores/post_store.jsx')
-rw-r--r-- | webapp/stores/post_store.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
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: |