0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-15 06:12:54 +01:00
discourse-custom-wizard/assets/javascripts/discourse/connectors/admin-dashboard-top/custom-wizard-critical-notice.js.es6
angusmcleod 81bb7e56c2 WIP
2021-11-17 20:26:44 +08:00

19 Zeilen
Kein EOL
597 B
JavaScript

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'));
});
}
};