mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 02:36:18 +08:00
29 lines
620 B
JavaScript
29 lines
620 B
JavaScript
import Component from "@ember/component";
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
|
|
|
export default Component.extend({
|
|
classNames: ["watched-word"],
|
|
watchedWord: null,
|
|
xIcon: iconHTML("times").htmlSafe(),
|
|
|
|
init() {
|
|
this._super(...arguments);
|
|
this.set("watchedWord", this.get("word.word"));
|
|
},
|
|
|
|
click() {
|
|
this.word
|
|
.destroy()
|
|
.then(() => {
|
|
this.action(this.word);
|
|
})
|
|
.catch(e => {
|
|
bootbox.alert(
|
|
I18n.t("generic_error_with_reason", {
|
|
error: `http: ${e.status} - ${e.body}`
|
|
})
|
|
);
|
|
});
|
|
}
|
|
});
|