2021-11-01 14:52:29 +01:00
|
|
|
import { getOwner } from "discourse-common/lib/get-owner";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
shouldRender(attrs, ctx) {
|
|
|
|
return ctx.siteSettings.wizard_critical_notices_on_dashboard;
|
|
|
|
},
|
|
|
|
|
|
|
|
setupComponent(attrs, component) {
|
2021-11-17 13:48:11 +01:00
|
|
|
const controller = getOwner(this).lookup("controller:admin-dashboard");
|
2021-11-01 14:52:29 +01:00
|
|
|
|
2021-11-17 13:48:11 +01:00
|
|
|
component.set("notices", controller.get("customWizardCriticalNotices"));
|
|
|
|
controller.addObserver("customWizardCriticalNotices.[]", () => {
|
2021-11-01 14:52:29 +01:00
|
|
|
if (this._state === "destroying") {
|
|
|
|
return;
|
|
|
|
}
|
2021-11-17 13:48:11 +01:00
|
|
|
component.set("notices", controller.get("customWizardCriticalNotices"));
|
2021-11-01 14:52:29 +01:00
|
|
|
});
|
2021-11-17 13:48:11 +01:00
|
|
|
},
|
|
|
|
};
|