diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 75341c346b9..75ffcad090c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -125,7 +125,7 @@ function getParticipantEmailsFromReport({sharedReportList}) { } /** - * Returns the title for a default room or generates one based on the participants + * Returns the title for a default room, a policy room or generates one based on the participants * * @param {Object} fullReport * @param {String} chatType @@ -142,6 +142,11 @@ function getChatReportName(fullReport, chatType) { : '')}`; } + // For a basic policy room, return its original name + if (ReportUtils.isPolicyRoom({chatType})) { + return fullReport.reportName; + } + const {sharedReportList} = fullReport; return _.chain(sharedReportList) .map(participant => participant.email) diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 245e9e6e426..a214bf3fade 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -85,8 +85,9 @@ const HeaderView = (props) => { }; }, ); + const isPolicyRoom = ReportUtils.isPolicyRoom(props.report); const isDefaultChatRoom = ReportUtils.isDefaultRoom(props.report); - const title = isDefaultChatRoom + const title = isDefaultChatRoom || isPolicyRoom ? props.report.reportName : _.map(displayNamesWithTooltips, ({displayName}) => displayName).join(', '); @@ -145,7 +146,7 @@ const HeaderView = (props) => { tooltipEnabled numberOfLines={1} textStyles={[styles.headerText]} - shouldUseFullTitle={isDefaultChatRoom} + shouldUseFullTitle={isDefaultChatRoom || isPolicyRoom} /> {isDefaultChatRoom && (