Skip to content

Commit

Permalink
Merge pull request #30712 from Expensify/revert-29860-27456-green-line
Browse files Browse the repository at this point in the history
[CP Staging] Revert "27456 Chat - The green line is displayed chaotically at the recipient"
  • Loading branch information
Beamanator authored Nov 1, 2023
2 parents bb51400 + 9f7d6b7 commit e108378
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e108378

Please sign in to comment.