From b3623449c801ef3a007051cb019d0fc20f7a0213 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 26 May 2015 18:00:41 +0930 Subject: [PATCH] Don't show load more button unnecessarily --- framework/core/js/forum/src/components/activity-page.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/core/js/forum/src/components/activity-page.js b/framework/core/js/forum/src/components/activity-page.js index d45bc40e7..f59ae1f23 100644 --- a/framework/core/js/forum/src/components/activity-page.js +++ b/framework/core/js/forum/src/components/activity-page.js @@ -12,6 +12,7 @@ export default class ActivityPage extends UserPage { this.loading = m.prop(true); this.moreResults = m.prop(false); this.activity = m.prop([]); + this.loadLimit = 20; var username = m.route.param('username').toLowerCase(); var users = app.store.all('users'); @@ -46,7 +47,7 @@ export default class ActivityPage extends UserPage { loadResults(offset) { return app.store.find('activity', { users: this.user().id(), - page: {offset}, + page: {offset, limit: this.loadLimit}, type: this.props.filter }) } @@ -60,7 +61,7 @@ export default class ActivityPage extends UserPage { parseResults(results, append) { this.loading(false); [].push.apply(this.activity(), results); - this.moreResults(!!results.length); + this.moreResults(results.length >= this.loadLimit); m.redraw(); return results; }