Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function AvatarWithDisplayName({
const parentReportActionParam = report?.parentReportActionID ? parentReportActions?.[report.parentReportActionID] : undefined;
const title = getReportName(report, undefined, parentReportActionParam, personalDetails, invoiceReceiverPolicy, reportAttributes);
const subtitle = getChatRoomSubtitle(report, {isCreateExpenseFlow: true});
const parentNavigationSubtitleData = getParentNavigationSubtitle(report, policy);
const parentNavigationSubtitleData = getParentNavigationSubtitle(report);
const isMoneyRequestOrReport = isMoneyRequestReport(report) || isMoneyRequest(report) || isTrackExpenseReport(report) || isInvoiceReport(report);
const icons = getIcons(report, personalDetails, null, '', -1, policy, invoiceReceiverPolicy);
const ownerPersonalDetails = getPersonalDetailsForAccountIDs(report?.ownerAccountID ? [report.ownerAccountID] : [], personalDetails);
Expand Down
19 changes: 2 additions & 17 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5403,29 +5403,14 @@ function getPendingChatMembers(accountIDs: number[], previousPendingChatMembers:
/**
* Gets the parent navigation subtitle for the report
*/
function getParentNavigationSubtitle(report: OnyxEntry<Report>, policy?: Policy): ParentNavigationSummaryParams {
function getParentNavigationSubtitle(report: OnyxEntry<Report>, invoiceReceiverPolicy?: OnyxEntry<Policy>): ParentNavigationSummaryParams {
const parentReport = getParentReport(report);
if (isEmptyObject(parentReport)) {
const ownerAccountID = report?.ownerAccountID;
const personalDetails = ownerAccountID ? allPersonalDetails?.[ownerAccountID] : undefined;
const login = personalDetails ? personalDetails.login : null;
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const reportOwnerDisplayName = getDisplayNameForParticipant({accountID: ownerAccountID, shouldRemoveDomain: true}) || login;

if (isExpenseReport(report)) {
return {
reportName: translateLocal('workspace.common.policyExpenseChatName', {displayName: reportOwnerDisplayName ?? ''}),
workspaceName: policy?.name,
};
}
if (isIOUReport(report)) {
return {reportName: reportOwnerDisplayName ?? ''};
}
return {};
}

if (isInvoiceReport(report) || isInvoiceRoom(parentReport)) {
let reportName = `${getPolicyName({report: parentReport})} & ${getInvoicePayerName(parentReport)}`;
let reportName = `${getPolicyName({report: parentReport})} & ${getInvoicePayerName(parentReport, invoiceReceiverPolicy)}`;

// This will get removed as part of https://github.com/Expensify/App/issues/59961
// eslint-disable-next-line deprecation/deprecation
Expand Down