correct blankish username not treated correctly in post stream

This commit is contained in:
Sam 2016-06-08 15:42:18 +10:00
parent 614f4ca228
commit 0e2d918b3b

View File

@ -27,7 +27,7 @@ export default createWidget('poster-name', {
html(attrs) { html(attrs) {
const username = attrs.username; const username = attrs.username;
const name = attrs.name; const name = attrs.name;
const nameFirst = this.siteSettings.display_name_on_posts && !this.siteSettings.prioritize_username_in_ux && name && name.length > 0; const nameFirst = this.siteSettings.display_name_on_posts && !this.siteSettings.prioritize_username_in_ux && name && name.trim().length > 0;
const classNames = nameFirst ? ['first','full-name'] : ['first','username']; const classNames = nameFirst ? ['first','full-name'] : ['first','username'];
if (attrs.staff) { classNames.push('staff'); } if (attrs.staff) { classNames.push('staff'); }