Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReportAction>): 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.
Expand Down Expand Up @@ -720,7 +730,7 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry<ReportAction>, 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;
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down