mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 00:43:39 +08:00
Don't show load more button unnecessarily
This commit is contained in:
parent
95e5a2d69d
commit
b3623449c8
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user