From 9b727207cd0626061d1bde7955b1f5f294789d48 Mon Sep 17 00:00:00 2001 From: Georgia Monahan <38015950+grgia@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:10:37 +0100 Subject: [PATCH] Revert "fix: don't show flagged message on LHN" --- src/libs/ReportActionsUtils.ts | 7 +----- src/libs/actions/Report.ts | 46 ---------------------------------- 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index adc2e241c42b..2e250ab84bc6 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -202,10 +202,6 @@ function isPendingRemove(reportAction: OnyxInputOrEntry): boolean return getReportActionMessage(reportAction)?.moderationDecision?.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_REMOVE; } -function isPendingHide(reportAction: OnyxInputOrEntry): boolean { - return getReportActionMessage(reportAction)?.moderationDecision?.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE; -} - function isMoneyRequestAction(reportAction: OnyxInputOrEntry): reportAction is ReportAction { return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.IOU); } @@ -939,7 +935,7 @@ function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxInputOrEntry< return ( shouldReportActionBeVisible(reportAction, reportAction.reportActionID, canUserPerformWriteAction) && (!(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction) && !isMoneyRequestAction(reportAction)) || isActionableMentionWhisper(reportAction)) && - !(isDeletedAction(reportAction) && !isDeletedParentAction(reportAction) && !isPendingHide(reportAction)) + !(isDeletedAction(reportAction) && !isDeletedParentAction(reportAction)) ); } @@ -3251,7 +3247,6 @@ export { getReceiptScanFailedMessage, getChangedApproverActionMessage, getDelegateAccountIDFromReportAction, - isPendingHide, }; export type {LastVisibleMessage}; diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index dc817e627059..c0fa66732ab9 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -4029,14 +4029,9 @@ function flagComment(reportID: string | undefined, reportAction: OnyxEntry = { - lastMessageText: '', - lastVisibleActionCreated: '', - }; - - const {lastMessageText = ''} = getLastVisibleMessage(originalReportID, { - [reportActionID]: {...reportAction, message: [updatedMessage], pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}, - } as ReportActions); - const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`]; - const canUserPerformWriteAction = canUserPerformWriteActionReportUtils(report); - if (lastMessageText) { - const lastVisibleAction = ReportActionsUtils.getLastVisibleAction(originalReportID, canUserPerformWriteAction, { - [reportActionID]: {...reportAction, message: [updatedMessage], pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}, - } as ReportActions); - const lastVisibleActionCreated = lastVisibleAction?.created; - const lastActorAccountID = lastVisibleAction?.actorAccountID; - optimisticReport = { - lastMessageText, - lastVisibleActionCreated, - lastActorAccountID, - }; - } - - if (shouldHideMessage) { - optimisticData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`, - value: optimisticReport, - }); - } - - const originalReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`]; - const failureData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, @@ -4098,14 +4060,6 @@ function flagComment(reportID: string | undefined, reportAction: OnyxEntry