Skip to content

Commit fe89a67

Browse files
committed
fix(lhn): update for deleted messages
1 parent ceae6d3 commit fe89a67

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libs/OptionsListUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import {
5656
isActionOfType,
5757
isClosedAction,
5858
isCreatedTaskReportAction,
59+
isDeletedAction,
5960
isDeletedParentAction,
6061
isModifiedExpenseAction,
6162
isMoneyRequestAction,
@@ -733,7 +734,7 @@ function getLastMessageTextForReport(report: OnyxEntry<Report>, lastActorDetails
733734
}
734735

735736
// we do not want to show report closed in LHN for non archived report so use getReportLastMessage as fallback instead of lastMessageText from report
736-
if (reportID && !isArchivedReport(reportNameValuePairs) && report.lastActionType === CONST.REPORT.ACTIONS.TYPE.CLOSED) {
737+
if (reportID && !isArchivedReport(reportNameValuePairs) && (isDeletedAction(lastOriginalReportAction) || report.lastActionType === CONST.REPORT.ACTIONS.TYPE.CLOSED)) {
737738
return lastMessageTextFromReport || (getReportLastMessage(reportID).lastMessageText ?? '');
738739
}
739740
return lastMessageTextFromReport || (report?.lastMessageText ?? '');

src/libs/ReportUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9068,10 +9068,11 @@ function getReportLastMessage(reportID: string, actionsToMerge?: ReportActions)
90689068
}
90699069

90709070
function getReportLastVisibleActionCreated(report: OnyxEntry<Report>, oneTransactionThreadReport: OnyxEntry<Report>) {
9071+
const lastVisibleReportActionCreated = getLastVisibleActionReportActionsUtils(report?.reportID)?.created ?? report?.lastVisibleActionCreated ?? ''
90719072
const lastVisibleActionCreated =
9072-
(oneTransactionThreadReport?.lastVisibleActionCreated ?? '') > (report?.lastVisibleActionCreated ?? '')
9073+
(oneTransactionThreadReport?.lastVisibleActionCreated ?? '') > lastVisibleReportActionCreated
90739074
? oneTransactionThreadReport?.lastVisibleActionCreated
9074-
: report?.lastVisibleActionCreated;
9075+
: lastVisibleReportActionCreated;
90759076

90769077
return lastVisibleActionCreated;
90779078
}

0 commit comments

Comments
 (0)