diff --git a/web/chat/message-preview.react.js b/web/chat/message-preview.react.js --- a/web/chat/message-preview.react.js +++ b/web/chat/message-preview.react.js @@ -48,30 +48,24 @@ threadInfo, getDefaultTextMessageRules().simpleMarkdownRules, ); - if (messageInfo.type === messageTypes.TEXT) { - let usernameText = null; - if ( - threadIsGroupChat(threadInfo) || + + let usernameText = null; + if ( + messageInfo.type === messageTypes.TEXT && + (threadIsGroupChat(threadInfo) || threadInfo.name !== '' || - messageInfo.creator.isViewer - ) { - const userString = stringForUser(messageInfo.creator); - const username = `${userString}: `; - usernameText = {username}; - } - return ( -
- {usernameText} - {messageTitle} -
- ); - } else { - return ( -
- {messageTitle} -
- ); + messageInfo.creator.isViewer) + ) { + const userString = stringForUser(messageInfo.creator); + usernameText = {`${userString}: `}; } + + return ( +
+ {usernameText} + {messageTitle} +
+ ); } export default MessagePreview;