diff options
Diffstat (limited to 'webapp/stores/post_store.jsx')
-rw-r--r-- | webapp/stores/post_store.jsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 135563866..0b2277255 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -548,6 +548,24 @@ class PostStoreClass extends EventEmitter { return commentCount; } + + filterPosts(channelId, joinLeave) { + const postsList = JSON.parse(JSON.stringify(this.getVisiblePosts(channelId))); + + if (!joinLeave && postsList) { + postsList.order = postsList.order.filter((id) => { + if (postsList.posts[id].type === Constants.POST_TYPE_JOIN_LEAVE) { + Reflect.deleteProperty(postsList.posts, id); + + return false; + } + + return true; + }); + } + + return postsList; + } } var PostStore = new PostStoreClass(); |