Page MenuHomePhabricator

D3504.id10691.diff
No OneTemporary

D3504.id10691.diff

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

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)

Event Timeline