Fix error when a user have no subName

This commit is contained in:
Oswaldo Acauan 2017-08-01 14:50:33 -03:00
parent df35a22676
commit 35fd834397

View File

@ -263,10 +263,13 @@ class UserListItem extends Component {
<span className={styles.userNameMain}>
{user.name} <i>{(user.isCurrent) ? `(${intl.formatMessage(messages.you)})` : ''}</i>
</span>
<span className={styles.userNameSub}>
{userNameSub
.reduce((prev, curr) => [prev, ' | ', curr])}
</span>
{
userNameSub ?
<span className={styles.userNameSub}>
{userNameSub.reduce((prev, curr) => [prev, ' | ', curr])}
</span>
: null
}
</div>
);
}