From d94ed7396cf336ef4940ddccb83ff989fcb5deda Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Tue, 17 Oct 2023 16:39:09 -0700 Subject: [PATCH] Update src/libs/PolicyUtils.js Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> --- src/libs/PolicyUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/PolicyUtils.js b/src/libs/PolicyUtils.js index fd3bc5420ce8..de902b53a7a4 100644 --- a/src/libs/PolicyUtils.js +++ b/src/libs/PolicyUtils.js @@ -161,7 +161,7 @@ const isPolicyAdmin = (policy) => lodashGet(policy, 'role') === CONST.POLICY.ROL * @param {Object} policies * @returns {Boolean} */ -const isPolicyMember = (policyID, policies) => _.reduce(policies, (isMember, policy) => isMember || policy.id === policyID, false); +const isPolicyMember = (policyID, policies) => _.some(policies, (policy) => policy.id === policyID); /** * @param {Object} policyMembers