fix: screensaver init timing + gemini key not wiped on settings save

- app.js: move initInactivityWatcher() inside syncSettingsFromDB().then()
  so it reads screensaver_enabled after server sync, not stale localStorage
- app.js: skip gemini_key/bring_password in save_settings POST when empty
  to avoid overwriting server .env with blank values
- api/index.php: add screensaver_enabled to getServerSettings() + saveSettings()
This commit is contained in:
dadaloop82
2026-05-06 05:14:10 +00:00
parent 14a7bbccbe
commit 521d8f8e47
2 changed files with 8 additions and 4 deletions
+2
View File
@@ -2077,6 +2077,7 @@ function getServerSettings(): void {
'scale_enabled' => env('SCALE_ENABLED', 'false') === 'true',
'scale_gateway_url' => env('SCALE_GATEWAY_URL', ''),
'meal_plan_enabled' => env('MEAL_PLAN_ENABLED', 'false') === 'true',
'screensaver_enabled' => env('SCREENSAVER_ENABLED', 'false') === 'true',
]);
}
@@ -2122,6 +2123,7 @@ function saveSettings(): void {
'pref_zerowaste' => 'PREF_ZEROWASTE',
'scale_enabled' => 'SCALE_ENABLED',
'meal_plan_enabled' => 'MEAL_PLAN_ENABLED',
'screensaver_enabled' => 'SCREENSAVER_ENABLED',
];
// Integer keys
$intMap = [