Commit fc9c3888 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Fix load more issue when all pages were loaded

parent 7ac007d0
......@@ -139,7 +139,9 @@ export default class EventList extends FilteredListPage {
const newPage = controller.pastEvents.lastLoadedPage + 1;
if (newPage <= controller.pastEvents.totalPages) {
await controller.pastEvents.loadPageData(newPage);
return newPage === controller.pastEvents.totalPages;
}
return false;
}
static _renderEventListItem(event, className = '') {
......
......@@ -313,8 +313,12 @@ export class FilteredListPage {
onclick: () => {
this.dataStore.loadMoreState = 'loading';
this._loadNextPage()
.then(() => {
.then(noMorePages => {
if (noMorePages) {
this.dataStore.loadMoreState = 'noMorePages';
} else {
this.dataStore.loadMoreState = 'idle';
}
m.redraw();
})
.catch(() => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment