Skip to content

Commit

Permalink
Merge pull request #29860 from roksanaz/27456-green-line
Browse files Browse the repository at this point in the history
27456 Chat - The green line is displayed chaotically at the recipient
  • Loading branch information
MonilBhavsar authored Oct 31, 2023
2 parents 02ad2fc + e5dc05e commit 36495e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,12 @@ function ReportActionsList({
if (!currentUnreadMarker) {
const nextMessage = sortedReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, report.lastReadTime);
shouldDisplay = isCurrentMessageUnread && (!nextMessage || !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 && (!nextMessage || isNextMessageRead) && isWithinVisibleThreshold;

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

0 comments on commit 36495e6

Please sign in to comment.