Skip to content

Commit

Permalink
Fix invoice room thread header
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Apr 30, 2024
1 parent 2182e9a commit e5c28ce
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3181,15 +3181,15 @@ function getPayeeName(report: OnyxEntry<Report>): string | undefined {
* Get either the policyName or domainName the chat is tied to
*/
function getChatRoomSubtitle(report: OnyxEntry<Report>): string | undefined {
if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
if (isChatThread(report)) {
return '';
}
if (isSelfDM(report)) {
return Localize.translateLocal('reportActionsView.yourSpace');
}
if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
if (!isDefaultRoom(report) && !isUserCreatedPolicyRoom(report) && !isPolicyExpenseChat(report)) {
return '';
}
Expand All @@ -3203,9 +3203,6 @@ function getChatRoomSubtitle(report: OnyxEntry<Report>): string | undefined {
if (isArchivedRoom(report)) {
return report?.oldPolicyName ?? '';
}
if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
return getPolicyName(report);
}

Expand All @@ -3226,7 +3223,7 @@ function getParentNavigationSubtitle(report: OnyxEntry<Report>): ParentNavigatio
return {};
}

if (isInvoiceReport(report)) {
if (isInvoiceReport(report) || isInvoiceRoom(parentReport)) {
return {reportName: `${getPolicyName(parentReport)} & ${getInvoicePayerName(parentReport)}`};
}

Expand Down

0 comments on commit e5c28ce

Please sign in to comment.