Commit 94b157b3 authored by Sandro Lutz's avatar Sandro Lutz Committed by Sandro Lutz
Browse files

Fix redraw issue with FilteredListPage

parent ffae899e
......@@ -3,6 +3,7 @@ import { apiUrl } from 'config';
import { getToken } from '../auth';
import EventListController from './EventListController';
import Event from './Event';
import Query from '../query';
/**
* EventController class
......@@ -78,12 +79,9 @@ export default class EventController {
/** Set a new query used by all EventListController to load events */
async setQuery(query) {
const newQuery = JSON.stringify(query || {});
const oldQuery = JSON.stringify(this.query);
if (Query.isEqual(this.query, query)) return false;
if (newQuery === oldQuery) return false;
this.query = JSON.parse(newQuery);
this.query = Query.copy(query);
this.openRegistrationEvents.setQuery(this.query);
this.upcomingEvents.setQuery(this.query);
this.pastEvents.setQuery(this.query);
......@@ -99,7 +97,6 @@ export default class EventController {
this.pastEvents.loadPageData(1),
];
await Promise.all(jobs);
m.redraw();
}
/** Get EventListController for all events with open registration window */
......
......@@ -104,7 +104,7 @@ export default class EventList extends FilteredListPage {
query.description_de = { $regex: `^(?i).*${value}.*` };
}
});
controller.setQuery({ where: query });
controller.setQuery({ where: query }).finally(() => m.redraw());
},
};
}
......
......@@ -74,7 +74,7 @@ export default class JobofferList extends FilteredListPage {
];
}
});
controller.setQuery({ where: query });
controller.setQuery({ where: query }).finally(() => m.redraw());
},
};
}
......
......@@ -168,7 +168,7 @@ export default class StudydocList extends FilteredListPage {
delete query.type;
}
});
controller.setQuery({ where: query });
controller.setQuery({ where: query }).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