From ae18e3006301043649612285b83015304100afbf Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 20 Jul 2015 18:13:40 +0930 Subject: [PATCH] Only render posts with the discussion relationship --- framework/core/js/forum/src/components/PostStream.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/core/js/forum/src/components/PostStream.js b/framework/core/js/forum/src/components/PostStream.js index aa81bbb79..26d05377f 100644 --- a/framework/core/js/forum/src/components/PostStream.js +++ b/framework/core/js/forum/src/components/PostStream.js @@ -167,7 +167,11 @@ class PostStream extends mixin(Component, evented) { posts() { return this.discussion.postIds() .slice(this.visibleStart, this.visibleEnd) - .map(id => app.store.getById('posts', id)); + .map(id => { + const post = app.store.getById('posts', id); + + return post && post.discussion() ? post : null; + }); } view() { @@ -365,10 +369,10 @@ class PostStream extends mixin(Component, evented) { this.discussion.postIds().slice(start, end).forEach(id => { const post = app.store.getById('posts', id); - if (!post) { - loadIds.push(id); - } else { + if (post && post.discussion()) { loaded.push(post); + } else { + loadIds.push(id); } });