DEV: only load staff logs when page is visited

Previously we would load admin staff action logs unconditionally as soon
as the controller was instantiated, this is not desirable we only want to
run the query when you visit the route.
This commit is contained in:
Sam Saffron 2020-04-03 14:13:01 +11:00
parent 2f9879a9a1
commit 83f5f9176b
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
2 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import { scheduleOnce } from "@ember/runloop";
import Controller from "@ember/controller";
import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
import discourseComputed, { on } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
model: null,
@ -17,7 +17,6 @@ export default Controller.extend({
return name ? I18n.t("admin.logs.staff_actions.actions." + name) : null;
},
@on("init")
resetFilters() {
this.setProperties({
model: EmberObject.create({ loadingMore: true }),

View File

@ -9,6 +9,11 @@ export default DiscourseRoute.extend({
});
},
activate() {
let controller = this.controllerFor("admin-logs-staff-action-logs");
if (controller.filters === null) controller.resetFilters();
},
actions: {
showDetailsModal(model) {
showModal("admin-staff-action-log-details", { model, admin: true });