update config on config changed event

This commit is contained in:
Eduard Gert
2026-06-15 16:13:03 +02:00
parent 8f200e8489
commit c7a338c006
2 changed files with 24 additions and 6 deletions
@@ -8,7 +8,10 @@ export function SettingsSecurity() {
const { t } = useTranslation();
const { config, setField } = useSettings();
const { mdm } = useRestrictions();
const showEncryptionSection = !(mdm.rosenpassEnabled && mdm.rosenpassPermissive);
const hideRosenpassEnabled = mdm.rosenpassEnabled;
const hideRosenpassPermissive =
mdm.rosenpassPermissive || (mdm.rosenpassEnabled && !config.rosenpassEnabled);
const showEncryptionSection = !(hideRosenpassEnabled && hideRosenpassPermissive);
return (
<>
@@ -31,7 +34,7 @@ export function SettingsSecurity() {
{showEncryptionSection && (
<SectionGroup title={t("settings.security.section.encryption")}>
{!mdm.rosenpassEnabled && (
{!hideRosenpassEnabled && (
<FancyToggleSwitch
value={config.rosenpassEnabled}
onChange={(v) => {
@@ -42,7 +45,7 @@ export function SettingsSecurity() {
helpText={t("settings.security.rosenpass.help")}
/>
)}
{!mdm.rosenpassPermissive && (
{!hideRosenpassPermissive && (
<FancyToggleSwitch
value={config.rosenpassPermissive}
onChange={(v) => setField("rosenpassPermissive", v)}