Skip to content

Commit 5d52ecd

Browse files
committed
fix: Sub-header / Workspace Chat Missing from Report View
1 parent 549b46a commit 5d52ecd

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/components/AvatarWithDisplayName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function AvatarWithDisplayName({
190190
const parentReportActionParam = report?.parentReportActionID ? parentReportActions?.[report.parentReportActionID] : undefined;
191191
const title = getReportName(report, undefined, parentReportActionParam, personalDetails, invoiceReceiverPolicy, reportAttributes);
192192
const subtitle = getChatRoomSubtitle(report, {isCreateExpenseFlow: true});
193-
const parentNavigationSubtitleData = getParentNavigationSubtitle(report);
193+
const parentNavigationSubtitleData = getParentNavigationSubtitle(report, undefined, policy);
194194
const isMoneyRequestOrReport = isMoneyRequestReport(report) || isMoneyRequest(report) || isTrackExpenseReport(report) || isInvoiceReport(report);
195195
const icons = getIcons(report, personalDetails, null, '', -1, policy, invoiceReceiverPolicy);
196196
const ownerPersonalDetails = getPersonalDetailsForAccountIDs(report?.ownerAccountID ? [report.ownerAccountID] : [], personalDetails);

src/libs/ReportUtils.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5383,9 +5383,24 @@ function getPendingChatMembers(accountIDs: number[], previousPendingChatMembers:
53835383
/**
53845384
* Gets the parent navigation subtitle for the report
53855385
*/
5386-
function getParentNavigationSubtitle(report: OnyxEntry<Report>, invoiceReceiverPolicy?: OnyxEntry<Policy>): ParentNavigationSummaryParams {
5386+
function getParentNavigationSubtitle(report: OnyxEntry<Report>, invoiceReceiverPolicy?: OnyxEntry<Policy>, policy?: Policy): ParentNavigationSummaryParams {
53875387
const parentReport = getParentReport(report);
53885388
if (isEmptyObject(parentReport)) {
5389+
const ownerAccountID = report?.ownerAccountID;
5390+
const personalDetails = ownerAccountID ? allPersonalDetails?.[ownerAccountID] : undefined;
5391+
const login = personalDetails ? personalDetails.login : null;
5392+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
5393+
const reportOwnerDisplayName = getDisplayNameForParticipant({accountID: ownerAccountID, shouldRemoveDomain: true}) || login;
5394+
5395+
if (isExpenseReport(report)) {
5396+
return {
5397+
reportName: translateLocal('workspace.common.policyExpenseChatName', {displayName: reportOwnerDisplayName ?? ''}),
5398+
workspaceName: policy?.name,
5399+
};
5400+
}
5401+
if (isIOUReport(report)) {
5402+
return {reportName: reportOwnerDisplayName ?? ''};
5403+
}
53895404
return {};
53905405
}
53915406

0 commit comments

Comments
 (0)