FEATURE: allow for for empty description in list

This commit is contained in:
Sam 2017-03-03 16:13:05 -05:00
parent c99f4260c0
commit 31a81d4eee
1 changed files with 12 additions and 2 deletions

View File

@ -26,7 +26,11 @@ createWidget('small-user-list', {
users = users.concat(avatarAtts(currentUser));
}
let description = I18n.t(atts.description, { icons: '' });
let description = null;
if (atts.description) {
description = I18n.t(atts.description, { icons: '' });
}
// oddly post_url is on the user
let postUrl;
@ -38,7 +42,13 @@ createWidget('small-user-list', {
if (postUrl) {
description = h('a', { attributes: { href: Discourse.getURL(postUrl) } }, description);
}
return [icons, description, '.'];
let buffer = [icons];
if (description) {
buffer.push(description);
buffer.push(".");
}
return buffer;
}
}
});