Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove buffered rendering from watched words

Blake Ericksonbb31e7f5b615
diff --git a/app/assets/javascripts/admin/components/admin-watched-word.js.es6 b/app/assets/javascripts/admin/components/admin-watched-word.js.es6
index 8a408cf1661..8e81ee36765 100644
--- a/app/assets/javascripts/admin/components/admin-watched-word.js.es6
+++ b/app/assets/javascripts/admin/components/admin-watched-word.js.es6
@@ -1,30 +1,29 @@
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";
-import { bufferedRender } from "discourse-common/lib/buffered-render";
import { escapeExpression } from "discourse/lib/utilities";
-export default Component.extend(
- bufferedRender({
- classNames: ["watched-word"],
+export default Component.extend({
+ classNames: ["watched-word"],
+ watchedWord: null,
+ xIcon: iconHTML("times").htmlSafe(),
- buildBuffer(buffer) {
- buffer.push(iconHTML("times"));
- buffer.push(` ${escapeExpression(this.get("word.word"))}`);
- },
+ init() {
+ this._super(...arguments);
+ this.set("watchedWord", `${escapeExpression(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}`
- })
- );
- });
- }
- })
-);
+ 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}`
+ })
+ );
+ });
+ }
+});
diff --git a/app/assets/javascripts/admin/templates/components/admin-watched-word.hbs b/app/assets/javascripts/admin/templates/components/admin-watched-word.hbs
new file mode 100644
index 00000000000..82e6b5431c1
--- /dev/null
+++ b/app/assets/javascripts/admin/templates/components/admin-watched-word.hbs
@@ -0,0 +1 @@
+{{xIcon}} {{watchedWord}}