From b5abfc1557fadca86e0822b90764754a9f827599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ca=C5=82ka?= <25438601+rafaucau@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:52:40 +0100 Subject: [PATCH] fix(optional-policies): hide Policies section in user profile when no optional policies exist --- js/src/forum/components/addManagePoliciesOption.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/forum/components/addManagePoliciesOption.js b/js/src/forum/components/addManagePoliciesOption.js index ed3b221..1c9500d 100644 --- a/js/src/forum/components/addManagePoliciesOption.js +++ b/js/src/forum/components/addManagePoliciesOption.js @@ -17,6 +17,9 @@ async function updatePolicy(policy, value) { export default function () { extend(SettingsPage.prototype, 'settingsItems', function (items) { const policies = app.store.all('fof-terms-policies').filter((policy) => policy.optional()); + if (!policies.length) { + return; + } let policyState = app.session.user.fofTermsPoliciesState();