FIX: Category drop shows undefined (#11090)

After 5fc239b535, the category dropdown
was showing "undefined" for the "all-categories" and "no-categories"
messages. This commit introduces a check to run the HTML parser only if
we're dealing with a real category, which fixes the above issue.
This commit is contained in:
Justin DiRose 2020-10-30 14:20:10 -05:00 committed by GitHub
parent c777ca4af1
commit 7b312b7bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -39,9 +39,11 @@ export default SelectKitRowComponent.extend({
"description",
"categoryName",
function () {
return htmlToText(
this.descriptionText || this.description || this.categoryName
);
if (this.category) {
return htmlToText(
this.descriptionText || this.description || this.categoryName
);
}
}
),