diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index 20e9259e8..d64531310 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -310,7 +310,7 @@ const MessageListContent = ({ const documentGroupId = !isMessageAlbum && message.groupedId ? message.groupedId : undefined; const nextDocumentGroupId = nextMessage && !isAlbum(nextMessage) ? nextMessage.groupedId : undefined; - const isTopicTopMessage = message.id === threadId; + const isThreadTopMessage = message.id === threadId; const position = { isFirstInGroup: messageIndex === 0, @@ -344,7 +344,7 @@ const MessageListContent = ({ observeIntersectionForPlaying={observeIntersectionForPlaying} album={album} noAvatars={noAvatars} - withAvatar={position.isLastInGroup && withUsers && !isOwn && (!isTopicTopMessage || !isComments)} + withAvatar={position.isLastInGroup && withUsers && !isOwn && (!isThreadTopMessage || !isComments)} withSenderName={position.isFirstInGroup && withUsers && !isOwn} threadId={threadId} messageListType={type} @@ -361,15 +361,6 @@ const MessageListContent = ({ onIntersectPinnedMessage={onIntersectPinnedMessage} getIsMessageListReady={getIsReady} />, - message.id === threadId && ( - // eslint-disable-next-line react-x/no-duplicate-key -
- - {oldLang(isEmptyThread - ? (isComments ? 'NoComments' : 'NoReplies') : 'DiscussionStarted')} - -
- ), ]); }).flat(); @@ -380,7 +371,7 @@ const MessageListContent = ({ const lastMessageId = getMessageOriginalId(lastMessage); const lastAppearanceOrder = messageCountToAnimate - appearanceIndex; - const isTopicTopMessage = lastMessage.id === threadId; + const isThreadTopMessage = lastMessage.id === threadId; const isOwn = isOwnMessage(lastMessage); const firstMessageOrAlbum = senderGroup[0]; @@ -391,8 +382,8 @@ const MessageListContent = ({ const id = (firstMessageId === lastMessageId) ? `message-group-${firstMessageId}` : `message-group-${firstMessageId}-${lastMessageId}`; - const withAvatar = withUsers && !isOwn && (!isTopicTopMessage || !isComments); - return ( + const withAvatar = withUsers && !isOwn && (!isThreadTopMessage || !isComments); + return compact([ {senderGroupElements} - - ); - }); + , + isThreadTopMessage && ( +
+ + {oldLang(isEmptyThread + ? (isComments ? 'NoComments' : 'NoReplies') : 'DiscussionStarted')} + +
+ ), + ]); + }).flat(); } const dateGroups = messageGroups.map((