fix: local-login toggle no longer reverts unsaved settings edits
Chart Release / chart (push) Successful in 26s
Server Deploy / deploy (push) Successful in 4m8s

server/internal/services/settings.go SaveSettings takes alerts and
email as required (non-pointer) values and writes them unconditionally
- absent fields would blank stored settings, not just leave them
alone. onLocalLoginChange was building its payload from the stale
loaded settings object instead of the in-progress form state
(thresholdMinutes/logRetentionDays) that handleSubmit uses, so editing
the offline threshold and then flipping the toggle silently reverted
the edit. Both paths now submit the same in-progress values.
This commit is contained in:
2026-08-03 14:13:05 +01:00
parent 5e016c6584
commit 6881d92d0a
+7 -2
View File
@@ -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,
});
}}