diff --git a/app/assets/javascripts/discourse/app/components/group-flair-inputs.js b/app/assets/javascripts/discourse/app/components/group-flair-inputs.js index b6a9cbaec04..8413569c918 100644 --- a/app/assets/javascripts/discourse/app/components/group-flair-inputs.js +++ b/app/assets/javascripts/discourse/app/components/group-flair-inputs.js @@ -8,9 +8,7 @@ import { action } from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { convertIconClass } from "discourse-common/lib/icon-library"; import discourseDebounce from "discourse-common/lib/debounce"; -import { escapeExpression } from "discourse/lib/utilities"; import getURL from "discourse-common/lib/get-url"; -import { htmlSafe } from "@ember/template"; export default Component.extend({ classNames: ["group-flair-inputs"], @@ -39,6 +37,10 @@ export default Component.extend({ }, _loadIcon() { + if (!this.model.flair_icon) { + return; + } + const icon = convertIconClass(this.model.flair_icon), c = "#svg-sprites", h = "ajax-icon-holder", @@ -71,42 +73,6 @@ export default Component.extend({ return flairUrl && flairUrl.includes("/") ? flairUrl : null; }, - @discourseComputed( - "model.flair_url", - "flairPreviewImage", - "model.flairBackgroundHexColor", - "model.flairHexColor" - ) - flairPreviewStyle( - flairUrl, - flairPreviewImage, - flairBackgroundHexColor, - flairHexColor - ) { - let style = ""; - - if (flairPreviewImage) { - style += `background-image: url(${escapeExpression(flairUrl)});`; - } - - if (flairBackgroundHexColor) { - style += `background-color: #${flairBackgroundHexColor};`; - } - - if (flairHexColor) { - style += `color: #${flairHexColor};`; - } - - return htmlSafe(style); - }, - - @discourseComputed("model.flairBackgroundHexColor") - flairPreviewClasses(flairBackgroundHexColor) { - if (flairBackgroundHexColor) { - return "rounded"; - } - }, - @discourseComputed("flairPreviewImage") flairPreviewLabel(flairPreviewImage) { const key = flairPreviewImage ? "image" : "icon"; diff --git a/app/assets/javascripts/discourse/app/templates/components/group-flair-inputs.hbs b/app/assets/javascripts/discourse/app/templates/components/group-flair-inputs.hbs index 94f140f845b..390f48ac059 100644 --- a/app/assets/javascripts/discourse/app/templates/components/group-flair-inputs.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/group-flair-inputs.hbs @@ -61,12 +61,13 @@ - {{#if flairPreviewImage}} -
- {{else if flairPreviewIcon}} -