fix(@desktop/community): empty tag string creation

This commit is contained in:
mprakhov 2023-01-11 15:04:38 +02:00 committed by Mykhailo Prakhov
parent 7d88adcbe1
commit 3de073edb8
1 changed files with 8 additions and 8 deletions

View File

@ -43,21 +43,21 @@ StatusSectionLayout {
property bool hasAddedContacts: false
readonly property string filteredSelectedTags: {
var tagsArray = []
if (community && community.tags) {
try {
const json = JSON.parse(community.tags);
const tagsArray = !!json ? json.map(tag => {
return tag.name;
}) : "";
return JSON.stringify(tagsArray);
const json = JSON.parse(community.tags)
if (!!json) {
tagsArray = json.map(tag => {
return tag.name
})
}
}
catch (e) {
console.warn("Error parsing community tags: ", community.tags, " error: ", e.message)
return ""
}
} else {
return "";
}
return JSON.stringify(tagsArray);
}
signal backToCommunityClicked