Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-14 22:02:53 +01:00
19 Zeilen
597 B
Text
19 Zeilen
597 B
Text
|
import { getOwner } from "discourse-common/lib/get-owner";
|
||
|
|
||
|
export default {
|
||
|
shouldRender(attrs, ctx) {
|
||
|
return ctx.siteSettings.wizard_critical_notices_on_dashboard;
|
||
|
},
|
||
|
|
||
|
setupComponent(attrs, component) {
|
||
|
const controller = getOwner(this).lookup('controller:admin-dashboard');
|
||
|
|
||
|
component.set('notices', controller.get('customWizardCriticalNotices'));
|
||
|
controller.addObserver('customWizardCriticalNotices.[]', () => {
|
||
|
if (this._state === "destroying") {
|
||
|
return;
|
||
|
}
|
||
|
component.set('notices', controller.get('customWizardCriticalNotices'));
|
||
|
});
|
||
|
}
|
||
|
};
|