Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3578,7 +3578,10 @@ function isUnread(report: OnyxEntry<Report>): boolean {
// lastVisibleActionCreated and lastReadTime are both datetime strings and can be compared directly
const lastVisibleActionCreated = report.lastVisibleActionCreated ?? '';
const lastReadTime = report.lastReadTime ?? '';
return lastReadTime < lastVisibleActionCreated;
const lastMentionedTime = report.lastMentionedTime ?? '';

// If the user was mentioned and the comment got deleted the lastMentionedTime will be more recent than the lastVisibleActionCreated
return lastReadTime < lastVisibleActionCreated || lastReadTime < lastMentionedTime;
}

function isIOUOwnedByCurrentUser(report: OnyxEntry<Report>, allReportsDict: OnyxCollection<Report> = null): boolean {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function ReportScreen({
oldPolicyName: reportProp.oldPolicyName,
policyName: reportProp.policyName,
isOptimisticReport: reportProp.isOptimisticReport,
lastMentionedTime: reportProp.lastMentionedTime,
}),
[
reportProp.lastReadTime,
Expand Down Expand Up @@ -242,6 +243,7 @@ function ReportScreen({
reportProp.oldPolicyName,
reportProp.policyName,
reportProp.isOptimisticReport,
reportProp.lastMentionedTime,
],
);

Expand Down