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 @@ -46,12 +46,12 @@ getDefaultTextMessageRules().simpleMarkdownRules, ); - if ( - messageInfo.type === messageTypes.TEXT && - (threadIsGroupChat(threadInfo) || - threadInfo.name !== '' || - messageInfo.creator.isViewer) - ) { + const hasUsername = + threadIsGroupChat(threadInfo) || + threadInfo.name !== '' || + messageInfo.creator.isViewer; + + if (messageInfo.type === messageTypes.TEXT && hasUsername) { const userString = stringForUser(messageInfo.creator); usernameText = {`${userString}: `}; }