Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401291
D3508.id10707.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
781 B
Referenced Files
None
Subscribers
None
D3508.id10707.diff
View Options
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
@@ -49,13 +49,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 = <span className={colorStyle}>{`${userString}: `}</span>;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 11:22 AM (4 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611499
Default Alt Text
D3508.id10707.diff (781 B)
Attached To
Mode
D3508: [web] [refactor] move hasUsername logic to variable
Attached
Detach File
Event Timeline
Log In to Comment