From 3cd0cb1b3e45691245a85fbd36d4d0c3ba58fc65 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 3 Apr 2024 18:23:34 +0800 Subject: [PATCH] skip whisper when mark as read except ACTIONABLEMENTIONWHISPER --- src/libs/actions/Report.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index a27f92ef8f57..8df6d1265e11 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1016,7 +1016,12 @@ function markCommentAsUnread(reportID: string, reportActionCreated: string) { // Find the latest report actions from other users const latestReportActionFromOtherUsers = Object.values(reportActions ?? {}).reduce((latest: ReportAction | null, current: ReportAction) => { - if (current.actorAccountID !== currentUserAccountID && (!latest || current.created > latest.created)) { + if ( + current.actorAccountID !== currentUserAccountID && + (!latest || current.created > latest.created) && + // Whisper action doesn't affect lastVisibleActionCreated, so skip whisper action except actionable mention whisper + (!ReportActionsUtils.isWhisperAction(current) || current.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER) + ) { return current; } return latest;