mirror of
https://github.com/discourse/discourse.git
synced 2025-03-11 15:35:44 +08:00
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:
parent
2f9879a9a1
commit
83f5f9176b
@ -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 }),
|
||||
|
@ -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 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user