diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index b5da21c0f67e..4990fc26746d 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2503,6 +2503,10 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu return getTransactionReportName(parentReportAction); } + if (parentReportAction?.message?.[0]?.isDeletedParentAction) { + return Localize.translateLocal('parentReportAction.deletedMessage'); + } + const isAttachment = ReportActionsUtils.isReportActionAttachment(!isEmptyObject(parentReportAction) ? parentReportAction : null); const parentReportActionMessage = (parentReportAction?.message?.[0]?.text ?? '').replace(/(\r\n|\n|\r)/gm, ' '); if (isAttachment && parentReportActionMessage) { @@ -2518,7 +2522,7 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu if (isAdminRoom(report) || isUserCreatedPolicyRoom(report)) { return getAdminRoomInvitedParticipants(parentReportAction, parentReportActionMessage); } - return parentReportActionMessage || Localize.translateLocal('parentReportAction.deletedMessage'); + return parentReportActionMessage; } if (isTaskReport(report) && isCanceledTaskReport(report, parentReportAction)) { diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 8f732a253cb5..ed3173381b32 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -41,6 +41,7 @@ type Message = { /** Fragment edited flag */ isEdited?: boolean; + /** Whether thread's parent message is deleted or not */ isDeletedParentAction?: boolean; /** Whether the pending transaction was reversed and didn't post to the card */