0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 22:02:53 +01:00
discourse-custom-wizard/assets/javascripts/discourse/controllers/admin-wizards.js.es6

27 Zeilen
735 B
Text

2021-11-01 14:52:29 +01:00
import Controller, { inject as controller } from "@ember/controller";
import { isPresent } from "@ember/utils";
import { A } from "@ember/array";
2021-09-24 11:58:42 +02:00
export default Controller.extend({
2021-11-01 14:52:29 +01:00
adminWizardsNotices: controller(),
unsubscribe() {
this.messageBus.unsubscribe("/custom-wizard/notices");
2021-10-19 14:49:06 +02:00
},
2021-11-01 14:52:29 +01:00
subscribe() {
this.unsubscribe();
this.messageBus.subscribe("/custom-wizard/notices", (data) => {
if (isPresent(data.active_notice_count)) {
this.set("activeNoticeCount", data.active_notice_count);
this.adminWizardsNotices.setProperties({
notices: A(),
page: 0,
2021-11-17 13:48:11 +01:00
canLoadMore: true,
2021-11-01 14:52:29 +01:00
});
this.adminWizardsNotices.loadMoreNotices();
}
});
2021-11-17 13:48:11 +01:00
},
2021-10-19 14:49:06 +02:00
});