31 lines
721 B
JavaScript
Raw Normal View History

2022-03-06 21:18:46 +01:00
import Component from "@ember/component";
import { popupAjaxError } from "discourse/lib/ajax-error";
2020-09-04 13:23:28 +02:00
import I18n from "I18n";
2022-03-06 21:18:46 +01:00
import bootbox from "bootbox";
2022-03-06 21:18:46 +01:00
export default Component.extend({
classNames: ["channel-details"],
actions: {
deleteChannel(channel) {
bootbox.confirm(
I18n.t("chat_integration.channel_delete_confirm"),
I18n.t("no_value"),
I18n.t("yes_value"),
2020-09-04 13:23:28 +02:00
(result) => {
if (result) {
channel
.destroyRecord()
.then(() => this.refresh())
.catch(popupAjaxError);
}
}
);
},
editRule(rule) {
this.editRuleWithChannel(rule, this.get("channel"));
2020-09-04 13:23:28 +02:00
},
},
2017-10-03 17:42:07 +08:00
});