diff --git a/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.test.tsx index b26d9e96cc9..4818104b55d 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.test.tsx @@ -50,6 +50,7 @@ describe('message', () => { isLastDeliveredMessage: false, hideHeader: false, message, + lastMessageInGroup: new ContentMessage(), onClickAvatar: jest.fn(), onClickButton: jest.fn(), onClickCancelRequest: jest.fn(), diff --git a/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.tsx b/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.tsx index deb4446f9c5..bbc72cf61c6 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/ContentMessage.tsx @@ -27,6 +27,7 @@ import {ReadIndicator} from 'Components/MessagesList/Message/ReadIndicator'; import {Conversation} from 'src/script/entity/Conversation'; import {CompositeMessage} from 'src/script/entity/message/CompositeMessage'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; +import {Message} from 'src/script/entity/message/Message'; import {useRelativeTimestamp} from 'src/script/hooks/useRelativeTimestamp'; import {StatusType} from 'src/script/message/StatusType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -58,6 +59,7 @@ export interface ContentMessageProps extends Omit void; onRetry: (message: ContentMessage) => void; quotedMessage?: ContentMessage; @@ -69,6 +71,7 @@ export interface ContentMessageProps extends Omit + )} diff --git a/src/script/components/MessagesList/Message/MessageWrapper.tsx b/src/script/components/MessagesList/Message/MessageWrapper.tsx index f9f19791d94..2f712a5ac6f 100644 --- a/src/script/components/MessagesList/Message/MessageWrapper.tsx +++ b/src/script/components/MessagesList/Message/MessageWrapper.tsx @@ -68,6 +68,7 @@ export const MessageWrapper: React.FC = ({ isFocused, isSelfTemporaryGuest, isLastDeliveredMessage, + lastMessageInGroup, shouldShowInvitePeople, hideHeader, hasReadReceiptsTurnedOn, @@ -184,6 +185,7 @@ export const MessageWrapper: React.FC = ({ return ( = ({ return messages.map(message => { const isLastDeliveredMessage = lastDeliveredMessage?.id === message.id; + const lastMessageInGroup = group.messages[messages.length - 1]; + const visibleCallback = getVisibleCallback(conversation, message); const key = `${message.id || 'message'}-${message.timestamp()}`; @@ -276,6 +278,7 @@ export const MessagesList: FC = ({ key={key} onVisible={visibleCallback} message={message} + lastMessageInGroup={lastMessageInGroup} hideHeader={message.timestamp() !== firstMessageTimestamp} messageActions={messageActions} conversation={conversation}