Skip to content

Commit b5d9c6d

Browse files
authored
Merge pull request #55895 from ishpaul777/fix-db-55855
[FIX] Track expense - Concierge message appears in self DM after deleting track expense
2 parents 890b430 + 1d83866 commit b5d9c6d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/libs/ReportActionsUtils.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,16 @@ function isActionableWhisper(
671671
const {POLICY_CHANGE_LOG: policyChangelogTypes, ROOM_CHANGE_LOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE;
672672
const supportedActionTypes: ReportActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)];
673673

674+
/**
675+
* Checks whether an action is actionable track expense and resolved.
676+
*
677+
*/
678+
function isResolvedActionableWhisper(reportAction: OnyxEntry<ReportAction>): boolean {
679+
const originalMessage = getOriginalMessage(reportAction);
680+
const resolution = originalMessage && typeof originalMessage === 'object' && 'resolution' in originalMessage ? originalMessage?.resolution : null;
681+
return !!resolution;
682+
}
683+
674684
/**
675685
* Checks if a reportAction is fit for display, meaning that it's not deprecated, is of a valid
676686
* and supported type, it's not deleted and also not closed.
@@ -720,7 +730,7 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry<ReportAction>, key:
720730
}
721731

722732
// If action is actionable whisper and resolved by user, then we don't want to render anything
723-
if (isActionableWhisper(reportAction) && getOriginalMessage(reportAction)?.resolution) {
733+
if (isActionableWhisper(reportAction) && isResolvedActionableWhisper(reportAction)) {
724734
return false;
725735
}
726736

src/pages/home/ReportScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
768768
const isSingleInvoiceReport = isInvoiceReport(report) && isMostRecentReportIOU && isSingleIOUReportAction;
769769
const shouldShowMostRecentReportAction =
770770
!!mostRecentReportAction &&
771+
shouldReportActionBeVisible(mostRecentReportAction, mostRecentReportAction.reportActionID, canUserPerformWriteAction(report)) &&
771772
!isSingleExpenseReport &&
772773
!isSingleInvoiceReport &&
773774
!isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&

0 commit comments

Comments
 (0)