Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3727392
D3504.id10691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3504.id10691.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
@@ -22,7 +22,15 @@
+threadInfo: ThreadInfo,
};
function MessagePreview(props: Props): React.Node {
- if (!props.messageInfo) {
+ const {
+ messageInfo: originalMessageInfo,
+ threadInfo,
+ threadInfo: {
+ currentUser: { unread },
+ },
+ } = props;
+
+ if (!originalMessageInfo) {
return (
<div className={classNames(css.lastMessage, css.dark, css.italic)}>
No messages
@@ -30,20 +38,20 @@
);
}
const messageInfo: ComposableMessageInfo | RobotextMessageInfo =
- props.messageInfo.type === messageTypes.SIDEBAR_SOURCE
- ? props.messageInfo.sourceMessage
- : props.messageInfo;
- const unread = props.threadInfo.currentUser.unread;
+ originalMessageInfo.type === messageTypes.SIDEBAR_SOURCE
+ ? originalMessageInfo.sourceMessage
+ : originalMessageInfo;
+
const messageTitle = getMessageTitle(
messageInfo,
- props.threadInfo,
+ threadInfo,
getDefaultTextMessageRules().simpleMarkdownRules,
);
if (messageInfo.type === messageTypes.TEXT) {
let usernameText = null;
if (
- threadIsGroupChat(props.threadInfo) ||
- props.threadInfo.name !== '' ||
+ threadIsGroupChat(threadInfo) ||
+ threadInfo.name !== '' ||
messageInfo.creator.isViewer
) {
const userString = stringForUser(messageInfo.creator);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 8:49 PM (11 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2826011
Default Alt Text
D3504.id10691.diff (1 KB)
Attached To
Mode
D3504: [web] [refactor] destructure props in message preview component
Attached
Detach File
Event Timeline
Log In to Comment