From 6ea60248e3a1760a0cc65366b74aa673f1e6428c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sevilla=20Mart=C3=ADn?= Date: Sun, 18 Mar 2018 20:37:04 -0400 Subject: [PATCH 1/3] always return a promise in PostStream#update --- js/forum/src/components/PostStream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/forum/src/components/PostStream.js b/js/forum/src/components/PostStream.js index 3b27884c4..e88f9adcb 100644 --- a/js/forum/src/components/PostStream.js +++ b/js/forum/src/components/PostStream.js @@ -122,7 +122,7 @@ class PostStream extends Component { * @public */ update() { - if (!this.viewingEnd) return; + if (!this.viewingEnd) return Promise.resolve(); this.visibleEnd = this.count(); From 92c8c616e17ebd37777871bc5e7c35f3078ad913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sevilla=20Mart=C3=ADn?= Date: Sat, 24 Mar 2018 17:43:03 -0400 Subject: [PATCH 2/3] Use m.deferred instead of native Promise --- js/forum/src/components/PostStream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/forum/src/components/PostStream.js b/js/forum/src/components/PostStream.js index e88f9adcb..13f5383e0 100644 --- a/js/forum/src/components/PostStream.js +++ b/js/forum/src/components/PostStream.js @@ -122,7 +122,8 @@ class PostStream extends Component { * @public */ update() { - if (!this.viewingEnd) return Promise.resolve(); + if (!this.viewingEnd) return m.deferred().resolve().promise; + this.visibleEnd = this.count(); From 4e2c32b108333723978c9b4cc2e8891fd058ec5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sevilla=20Mart=C3=ADn?= Date: Sat, 24 Mar 2018 17:43:14 -0400 Subject: [PATCH 3/3] remove extra space --- js/forum/src/components/PostStream.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/forum/src/components/PostStream.js b/js/forum/src/components/PostStream.js index 13f5383e0..09a1288e7 100644 --- a/js/forum/src/components/PostStream.js +++ b/js/forum/src/components/PostStream.js @@ -124,7 +124,6 @@ class PostStream extends Component { update() { if (!this.viewingEnd) return m.deferred().resolve().promise; - this.visibleEnd = this.count(); return this.loadRange(this.visibleStart, this.visibleEnd).then(() => m.redraw());