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
6 changes: 3 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7817,8 +7817,8 @@ function hasMissingInvoiceBankAccount(iouReportID: string): boolean {
return invoiceReport?.ownerAccountID === currentUserAccountID && isEmptyObject(getPolicy(invoiceReport?.policyID)?.invoice?.bankAccount ?? {}) && isSettled(iouReportID);
}

function isExpenseReportManagerWithoutParentAccess(report: OnyxEntry<Report>) {
return isExpenseReport(report) && report?.hasParentAccess === false && report?.managerID === currentUserAccountID;
function isExpenseReportWithoutParentAccess(report: OnyxEntry<Report>) {
return isExpenseReport(report) && report?.hasParentAccess === false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check function and its usage led to the following issue:

which we fixed by removing the isExpenseReportWithoutParentAccess check after this discussion.

}

export {
Expand Down Expand Up @@ -8016,7 +8016,7 @@ export {
isEmptyReport,
isRootGroupChat,
isExpenseReport,
isExpenseReportManagerWithoutParentAccess,
isExpenseReportWithoutParentAccess,
isExpenseRequest,
isExpensifyOnlyParticipantInReport,
isGroupChat,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ function getOrderedReportIDs(
return;
}
const isSystemChat = ReportUtils.isSystemChat(report);
const isExpenseReportManagerWithoutParentAccess = ReportUtils.isExpenseReportManagerWithoutParentAccess(report);
const isExpenseReportWithoutParentAccess = ReportUtils.isExpenseReportWithoutParentAccess(report);
const shouldOverrideHidden =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isExpenseReportManagerWithoutParentAccess;
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isExpenseReportWithoutParentAccess;
if (isHidden && !shouldOverrideHidden) {
return;
}
Expand Down