From 026e6361e569edc14909b964294e6e55c328aabf Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 29 May 2015 18:55:53 +0930 Subject: [PATCH] Fix edge cases where posts would not be added/removed --- framework/core/js/forum/src/components/post-stream.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/js/forum/src/components/post-stream.js b/framework/core/js/forum/src/components/post-stream.js index 02536f2eb..378e9873d 100644 --- a/framework/core/js/forum/src/components/post-stream.js +++ b/framework/core/js/forum/src/components/post-stream.js @@ -87,7 +87,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.push(post); this.visibleEnd++; } @@ -99,7 +99,7 @@ class PostStream extends mixin(Component, evented) { */ removePost(id) { this.posts.some((item, i) => { - if (item && item.id() === id) { + if (item && item.id() == id) { this.posts.splice(i, 1); this.visibleEnd--; return true;