mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 05:02:24 +08:00
eab560fe2a
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com> Co-authored-by: Robin Ward <robin.ward@gmail.com> Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
30 lines
645 B
JavaScript
30 lines
645 B
JavaScript
import I18n from "I18n";
|
|
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}`
|
|
})
|
|
);
|
|
});
|
|
}
|
|
});
|