diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index e3bb3a797432..e6f9810ab336 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -671,6 +671,16 @@ function isActionableWhisper( const {POLICY_CHANGE_LOG: policyChangelogTypes, ROOM_CHANGE_LOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; const supportedActionTypes: ReportActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]; +/** + * Checks whether an action is actionable track expense and resolved. + * + */ +function isResolvedActionableWhisper(reportAction: OnyxEntry): boolean { + const originalMessage = getOriginalMessage(reportAction); + const resolution = originalMessage && typeof originalMessage === 'object' && 'resolution' in originalMessage ? originalMessage?.resolution : null; + return !!resolution; +} + /** * Checks if a reportAction is fit for display, meaning that it's not deprecated, is of a valid * and supported type, it's not deleted and also not closed. @@ -720,7 +730,7 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry, key: } // If action is actionable whisper and resolved by user, then we don't want to render anything - if (isActionableWhisper(reportAction) && getOriginalMessage(reportAction)?.resolution) { + if (isActionableWhisper(reportAction) && isResolvedActionableWhisper(reportAction)) { return false; } diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 7b29bef35a5a..39a670b43284 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -768,6 +768,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) { const isSingleInvoiceReport = isInvoiceReport(report) && isMostRecentReportIOU && isSingleIOUReportAction; const shouldShowMostRecentReportAction = !!mostRecentReportAction && + shouldReportActionBeVisible(mostRecentReportAction, mostRecentReportAction.reportActionID, canUserPerformWriteAction(report)) && !isSingleExpenseReport && !isSingleInvoiceReport && !isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&