From 6d5d40b8e3a4d28329cfc28d4e009e65b3533553 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Mon, 13 Dec 2021 11:03:48 +0530 Subject: [PATCH] Fix multiple unread divider Signed-off-by: Ajay Bura --- src/app/organisms/room/RoomViewContent.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/organisms/room/RoomViewContent.jsx b/src/app/organisms/room/RoomViewContent.jsx index f78cbda..e0dad04 100644 --- a/src/app/organisms/room/RoomViewContent.jsx +++ b/src/app/organisms/room/RoomViewContent.jsx @@ -83,7 +83,9 @@ function handleOnClickCapture(e) { } function renderEvent(roomTimeline, mEvent, prevMEvent, isFocus = false) { - const isBodyOnly = (prevMEvent !== null && prevMEvent.getType() !== 'm.room.member' + const isBodyOnly = (prevMEvent !== null + && prevMEvent.getType() !== 'm.room.member' + && prevMEvent.getType() !== 'm.room.create' && diffMinutes(mEvent.getDate(), prevMEvent.getDate()) <= MAX_MSG_DIFF_MINUTES && prevMEvent.getSender() === mEvent.getSender() ); @@ -577,6 +579,7 @@ function RoomViewContent({ eventId, roomTimeline }) { let itemCountIndex = 0; jumpToItemIndex = -1; const readEvent = readEventStore.getItem(); + let unreadDivider = false; if (roomTimeline.canPaginateBackward() || limit.from > 0) { tl.push(loadingMsgPlaceholders(1, PLACEHOLDER_COUNT)); @@ -599,7 +602,7 @@ function RoomViewContent({ eventId, roomTimeline }) { } } - const unreadDivider = (readEvent + unreadDivider = (readEvent && !unreadDivider && prevMEvent?.getTs() <= readEvent.getTs() && readEvent.getTs() < mEvent.getTs()); if (unreadDivider) {