From 9f7d6b7e5af6dce43f61d040f9dd71c88f94cdc3 Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Wed, 1 Nov 2023 22:05:32 +0530 Subject: [PATCH] Revert "27456 Chat - The green line is displayed chaotically at the recipient" --- src/pages/home/report/ReportActionsList.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 2bd969364e31..4fd2bd21c99e 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -303,12 +303,9 @@ function ReportActionsList({ if (!currentUnreadMarker) { const nextMessage = sortedReportActions[index + 1]; const isCurrentMessageUnread = isMessageUnread(reportAction, report.lastReadTime); - const isNextMessageRead = !isMessageUnread(nextMessage, report.lastReadTime); - const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < userActiveSince.current : true; - shouldDisplay = isCurrentMessageUnread && (!nextMessage || isNextMessageRead) && isWithinVisibleThreshold; - - if (shouldDisplay && !messageManuallyMarkedUnread) { - shouldDisplay = reportAction.actorAccountID !== Report.getCurrentUserAccountID(); + shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, report.lastReadTime)); + if (!messageManuallyMarkedUnread) { + shouldDisplay = shouldDisplay && reportAction.actorAccountID !== Report.getCurrentUserAccountID(); } } else { shouldDisplay = reportAction.reportActionID === currentUnreadMarker;