Skip to content

Commit

Permalink
Merge pull request #52533 from ikevin127/ikevin127-hideHasParentAcces…
Browse files Browse the repository at this point in the history
…sFalse

Priority Mode: Focus - Hide LHN reports that don't have parent access
  • Loading branch information
puneetlath authored Nov 18, 2024
2 parents af42423 + cc42915 commit a7cd2b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8424,10 +8424,6 @@ function hasMissingInvoiceBankAccount(iouReportID: string): boolean {
return invoiceReport?.ownerAccountID === currentUserAccountID && !getPolicy(invoiceReport?.policyID)?.invoice?.bankAccount?.transferBankAccountID && isSettled(iouReportID);
}

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

function hasInvoiceReports() {
const allReports = Object.values(ReportConnection.getAllReports() ?? {});
return allReports.some((report) => isInvoiceReport(report));
Expand Down Expand Up @@ -8637,7 +8633,6 @@ export {
isEmptyReport,
isRootGroupChat,
isExpenseReport,
isExpenseReportWithoutParentAccess,
isExpenseRequest,
isExpensifyOnlyParticipantInReport,
isGroupChat,
Expand Down
8 changes: 6 additions & 2 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ function getOrderedReportIDs(
return;
}
const isSystemChat = ReportUtils.isSystemChat(report);
const isExpenseReportWithoutParentAccess = ReportUtils.isExpenseReportWithoutParentAccess(report);
const shouldOverrideHidden =
hasValidDraftComment(report.reportID) ||
hasErrorsOtherThanFailedReceipt ||
isFocused ||
isSystemChat ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isExpenseReportWithoutParentAccess;
report.isPinned ||
ReportUtils.requiresAttentionFromCurrentUser(report, parentReportAction);
if (isHidden && !shouldOverrideHidden) {
return;
}
Expand Down

0 comments on commit a7cd2b9

Please sign in to comment.