Skip to content

Commit

Permalink
Fix: 27456 green line
Browse files Browse the repository at this point in the history
  • Loading branch information
roksanaz committed Oct 18, 2023
1 parent 9664f8c commit 1ea93f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,13 @@ function ReportActionsList({
if (!currentUnreadMarker) {
const nextMessage = sortedReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, report.lastReadTime);
shouldDisplay = isCurrentMessageUnread && !isMessageUnread(nextMessage, report.lastReadTime);
if (!messageManuallyMarkedUnread) {
shouldDisplay = shouldDisplay && reportAction.actorAccountID !== Report.getCurrentUserAccountID();
const isNextMessageRead = !isMessageUnread(nextMessage, report.lastReadTime);
const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < userActiveSince.current : true;

shouldDisplay = isCurrentMessageUnread && isNextMessageRead && isWithinVisibleThreshold;

if (shouldDisplay && !messageManuallyMarkedUnread) {
shouldDisplay = reportAction.actorAccountID !== Report.getCurrentUserAccountID();
}
} else {
shouldDisplay = reportAction.reportActionID === currentUnreadMarker;
Expand Down

0 comments on commit 1ea93f7

Please sign in to comment.