FIX: Ensure badge description is updated when routing without loading state (#12196)

This commit is contained in:
David Taylor 2021-02-24 10:16:47 +00:00 committed by GitHub
parent de32fa299d
commit d22ab6fe22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -22,14 +22,13 @@ export default Component.extend({
}
},
@discourseComputed("size")
summary(size) {
@discourseComputed("size", "badge.long_description", "badge.description")
summary(size, longDescription, description) {
if (size === "large") {
const longDescription = this.get("badge.long_description");
if (!isEmpty(longDescription)) {
return emojiUnescape(sanitize(longDescription));
}
}
return sanitize(this.get("badge.description"));
return sanitize(description);
},
});