From ca15e69ae02b7aba632f634da902cc5b2017e2d9 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Tue, 14 Dec 2021 20:47:01 +0530 Subject: [PATCH] Fix multiple new message indicator Signed-off-by: Ajay Bura --- src/app/organisms/room/RoomViewContent.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/organisms/room/RoomViewContent.jsx b/src/app/organisms/room/RoomViewContent.jsx index c7ba8f9..7570619 100644 --- a/src/app/organisms/room/RoomViewContent.jsx +++ b/src/app/organisms/room/RoomViewContent.jsx @@ -608,13 +608,15 @@ function RoomViewContent({ eventId, roomTimeline }) { } } - unreadDivider = (readEvent && !unreadDivider - && prevMEvent?.getTs() <= readEvent.getTs() - && readEvent.getTs() < mEvent.getTs()); - if (unreadDivider) { - tl.push(); - itemCountIndex += 1; - if (jumpToItemIndex === -1) jumpToItemIndex = itemCountIndex; + if (!unreadDivider) { + unreadDivider = (readEvent + && prevMEvent?.getTs() <= readEvent.getTs() + && readEvent.getTs() < mEvent.getTs()); + if (unreadDivider) { + tl.push(); + itemCountIndex += 1; + if (jumpToItemIndex === -1) jumpToItemIndex = itemCountIndex; + } } const dayDivider = prevMEvent && !isInSameDay(mEvent.getDate(), prevMEvent.getDate()); if (dayDivider) {