Commit f2545788 authored by scmoritz's avatar scmoritz
Browse files

Fix redraw issues with await

parent 6ad78d63
......@@ -94,9 +94,13 @@ export default class EventController {
/** Refresh all event data */
async refresh() {
await this.openRegistrationEvents.loadAll();
await this.upcomingEvents.loadAll();
await this.pastEvents.loadPageData(1);
const jobs = [
this.openRegistrationEvents.loadAll(),
this.upcomingEvents.loadAll(),
this.pastEvents.loadPageData(1),
];
await Promise.all(jobs);
m.redraw();
}
/** Get EventListController for all events with open registration window */
......
......@@ -253,6 +253,9 @@ export class FilteredListPage {
.catch(err => {
error(err);
this.dataStore.listState = 'error';
})
.finally(() => {
m.redraw();
});
}
......@@ -329,10 +332,12 @@ export class FilteredListPage {
this._loadNextPage()
.then(() => {
this.dataStore.loadMoreState = 'idle';
m.redraw();
})
.catch(() => {
this.dataStore.loadMoreState = 'error';
})
.finally(() => {
m.redraw();
});
},
},
......
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