Skip to content

Commit

Permalink
use policyName sent back with public rooms for people who aren't in t…
Browse files Browse the repository at this point in the history
…he workspace
  • Loading branch information
jasperhuangg committed Feb 28, 2023
1 parent eb183ac commit fe335c5
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 @@ -281,10 +281,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 fe335c5

Please sign in to comment.