fix: dark mode resets to auto on reload — bootstrap dark_mode from localStorage in getSettings()

This commit is contained in:
dadaloop82
2026-05-21 18:33:33 +00:00
parent 3b100df26c
commit b89df961a6
+2
View File
@@ -2073,7 +2073,9 @@ function getSettings() {
if (!_settingsCache) {
// Settings come from server — do NOT read from localStorage (per-device storage).
// _settingsCache is populated by _applySyncedSettings() on app init.
// Exception: dark_mode is intentionally device-local (stored in localStorage).
_settingsCache = {};
try { const dm = localStorage.getItem('evershelf_dark_mode'); if (dm) _settingsCache.dark_mode = dm; } catch(_) {}
}
const s = _settingsCache;
// Build recipe_prefs array from individual booleans