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