2023-01-23 10:30:48 -08:00
|
|
|
import Component from "@glimmer/component";
|
2018-08-20 12:05:59 +01:00
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2020-09-04 13:23:28 +02:00
|
|
|
import I18n from "I18n";
|
2022-10-27 10:16:00 -03:00
|
|
|
import { inject as service } from "@ember/service";
|
2023-01-23 10:30:48 -08:00
|
|
|
import { action } from "@ember/object";
|
2017-07-18 16:17:03 +01:00
|
|
|
|
2023-01-23 10:30:48 -08:00
|
|
|
export default class ChannelDetails extends Component {
|
|
|
|
@service dialog;
|
|
|
|
@service siteSettings;
|
2017-07-18 16:17:03 +01:00
|
|
|
|
2023-01-23 10:30:48 -08:00
|
|
|
@action
|
|
|
|
deleteChannel(channel) {
|
|
|
|
this.dialog.deleteConfirm({
|
|
|
|
message: I18n.t("chat_integration.channel_delete_confirm"),
|
|
|
|
didConfirm: () => {
|
|
|
|
return channel
|
|
|
|
.destroyRecord()
|
|
|
|
.then(() => this.args.refresh())
|
|
|
|
.catch(popupAjaxError);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|