Skip to content

Commit

Permalink
Merge pull request #15546 from Expensify/jasper-policyNameForPublicRooms
Browse files Browse the repository at this point in the history
Use policyName sent back with public rooms for people who aren't in the workspace
  • Loading branch information
jasperhuangg authored Mar 2, 2023
2 parents 84e37e6 + fe335c5 commit bff8b0b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,17 @@ function isArchivedRoom(report) {
* @param {Object} report
* @param {String} report.policyID
* @param {String} report.oldPolicyName
* @param {String} report.policyName
* @param {Object} policies must have Onyxkey prefix (i.e 'policy_') for keys
* @returns {String}
*/
function getPolicyName(report, policies) {
// Public rooms send back the policy name with the reportSummary,
// since they can also be accessed by people who aren't in the workspace
if (report.policyName) {
return report.policyName;
}

if (_.isEmpty(policies)) {
return Localize.translateLocal('workspace.common.unavailable');
}
Expand Down

0 comments on commit bff8b0b

Please sign in to comment.