From aea8b17175cc502db893161090914592469067b5 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 24 Oct 2015 13:17:25 +1030 Subject: [PATCH] Improve logic to see if post has been fully loaded Should fix #295 once and for all. --- framework/core/js/forum/src/components/PostStream.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/js/forum/src/components/PostStream.js b/framework/core/js/forum/src/components/PostStream.js index 7a8715176..38b710976 100644 --- a/framework/core/js/forum/src/components/PostStream.js +++ b/framework/core/js/forum/src/components/PostStream.js @@ -179,7 +179,7 @@ class PostStream extends Component { .map(id => { const post = app.store.getById('posts', id); - return post && post.discussion() && post.canEdit() !== null ? post : null; + return post && post.discussion() && typeof post.canEdit() !== 'undefined' ? post : null; }); } @@ -391,7 +391,7 @@ class PostStream extends Component { this.discussion.postIds().slice(start, end).forEach(id => { const post = app.store.getById('posts', id); - if (post && post.discussion()) { + if (post && post.discussion() && typeof post.canEdit() !== 'undefined') { loaded.push(post); } else { loadIds.push(id);