24 lines
633 B
JavaScript
Raw Normal View History

2023-01-23 10:30:48 -08:00
import Component from "@glimmer/component";
import { popupAjaxError } from "discourse/lib/ajax-error";
2020-09-04 13:23:28 +02:00
import I18n from "I18n";
import { inject as service } from "@ember/service";
2023-01-23 10:30:48 -08:00
import { action } from "@ember/object";
2023-01-23 10:30:48 -08:00
export default class ChannelDetails extends Component {
@service dialog;
@service siteSettings;
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);
},
});
}
}