From 01b27d9180977283a8c874b591e6788283fad603 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Fri, 1 Dec 2023 14:28:33 +0100 Subject: [PATCH] fix failing test --- src/pages/home/report/ReportActionsList.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index d1050f4c0930..8e63f508f8ce 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -337,14 +337,13 @@ function ReportActionsList({ const nextMessage = sortedReportActions[index + 1]; const isCurrentMessageUnread = isMessageUnread(reportAction, lastReadTimeRef.current); shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current)); - if (!messageManuallyMarkedUnread) { + if (shouldDisplay && !messageManuallyMarkedUnread) { const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < userActiveSince.current : true; // Check if the report type is "REPORTREVIEW" and last actor is the current user. // This is to avoid displaying the new line marker when a current userrequests money. shouldDisplay = - shouldDisplay && ReportActionsUtils.isReportPreviewAction(reportAction) - ? reportAction.childLastActorAccountID - : reportAction.actorAccountID !== Report.getCurrentUserAccountID() && isWithinVisibleThreshold; + (ReportActionsUtils.isReportPreviewAction(reportAction) ? !reportAction.childLastActorAccountID : reportAction.actorAccountID !== Report.getCurrentUserAccountID()) && + isWithinVisibleThreshold; } if (shouldDisplay) { cacheUnreadMarkers.set(report.reportID, reportAction.reportActionID);