diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 1968423a864c..1151688ebc0a 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7728,6 +7728,10 @@ function getApprovalChain(policy: OnyxEntry, employeeAccountID: number, return approvalChain; } +function isSubmittedExpenseReportManagerWithoutParentAccess(report: OnyxEntry) { + return isExpenseReport(report) && report?.hasParentAccess === false && report?.managerID === currentUserAccountID && isProcessingReport(report); +} + export { addDomainToShortMention, completeShortMention, @@ -7923,6 +7927,7 @@ export { isEmptyReport, isRootGroupChat, isExpenseReport, + isSubmittedExpenseReportManagerWithoutParentAccess, isExpenseRequest, isExpensifyOnlyParticipantInReport, isGroupChat, diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index dedd608ce77d..0e84f5c9944c 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -129,7 +129,10 @@ function getOrderedReportIDs( return; } const isSystemChat = ReportUtils.isSystemChat(report); - const shouldOverrideHidden = hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned; + const isSubmittedExpenseReportManagerWithoutParentAccess = ReportUtils.isSubmittedExpenseReportManagerWithoutParentAccess(report); + const shouldOverrideHidden = + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isSubmittedExpenseReportManagerWithoutParentAccess; if (isHidden && !shouldOverrideHidden) { return; }