diff --git a/framework/core/js/forum/src/components/post-stream.js b/framework/core/js/forum/src/components/post-stream.js index d92229710..61996411b 100644 --- a/framework/core/js/forum/src/components/post-stream.js +++ b/framework/core/js/forum/src/components/post-stream.js @@ -88,7 +88,7 @@ class PostStream extends mixin(Component, evented) { stream is not visible. */ pushPost(post) { - if (this.visibleEnd >= this.count() - 1) { + if (this.visibleEnd >= this.count() - 1 && this.posts.indexOf(post) === -1) { this.posts.push(post); this.visibleEnd++; } diff --git a/framework/core/js/lib/models/discussion.js b/framework/core/js/lib/models/discussion.js index ed2cdbeaf..20dee1926 100644 --- a/framework/core/js/lib/models/discussion.js +++ b/framework/core/js/lib/models/discussion.js @@ -17,7 +17,11 @@ class Discussion extends Model { } if (newData.links && newData.links.addedPosts) { - [].push.apply(posts.linkage, newData.links.addedPosts.linkage); + newData.links.addedPosts.linkage.forEach(linkage => { + if (posts.linkage[posts.linkage.length - 1].id != linkage.id) { + posts.linkage.push(linkage); + } + }); } } }