diff --git a/web/app/(app)/settings/page.tsx b/web/app/(app)/settings/page.tsx index 06a737c..44236ea 100644 --- a/web/app/(app)/settings/page.tsx +++ b/web/app/(app)/settings/page.tsx @@ -195,10 +195,15 @@ export default function SettingsPage() { localLoginEnabled={settings?.local_login_enabled ?? true} onLocalLoginChange={(v) => { if (!settings) return; + // Same in-progress form state the main Save button submits + // (handleSubmit below), not the stale loaded `settings` + // object — otherwise an unsaved edit to the offline + // threshold or retention days is silently reverted the + // moment this toggle is flipped. save({ - alerts: settings.alerts, + alerts: { ...settings.alerts, offline_threshold_minutes: thresholdMinutes }, email: settings.email, - workflow_log_retention_days: settings.workflow_log_retention_days, + workflow_log_retention_days: logRetentionDays, local_login_enabled: v, }); }}