diff --git a/apps/admin-x-settings/src/components/settings/membership/portal/SignupOptions.tsx b/apps/admin-x-settings/src/components/settings/membership/portal/SignupOptions.tsx index 0391add212..e13bd61939 100644 --- a/apps/admin-x-settings/src/components/settings/membership/portal/SignupOptions.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/portal/SignupOptions.tsx @@ -66,13 +66,22 @@ const SignupOptions: React.FC<{ localTiers.forEach((tier) => { if (tier.name === 'Free') { tiersCheckboxes.push({ - checked: tier.visibility === 'public', + checked: (portalPlans.includes('free')), disabled: isDisabled, label: 'Free', value: 'free', onChange: (checked) => { + if (portalPlans.includes('free') && !checked) { + portalPlans.splice(portalPlans.indexOf('free'), 1); + } + + if (!portalPlans.includes('free') && checked) { + portalPlans.push('free'); + } + + updateSetting('portal_plans', JSON.stringify(portalPlans)); + updateTier({...tier, visibility: checked ? 'public' : 'none'}); - togglePlan('free'); } }); }