From fe335c571bac2bd6eb6714d6379f066e7c47cad7 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Mon, 27 Feb 2023 18:51:09 -0800 Subject: [PATCH] use policyName sent back with public rooms for people who aren't in the workspace --- src/libs/ReportUtils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 4c03e35b642c..f1bf49db3242 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -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'); }