Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
teneeto committed Dec 1, 2023
1 parent 3bf9149 commit 01b27d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 01b27d9

Please sign in to comment.