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