fix(dashboard): persist the currency & timezone widgets so an upgrade keeps them (#1311)

The currency and timezone widgets stored their state only in browser localStorage, so a (docker) upgrade that clears site storage reset them to defaults — unlike every other preference, which is saved server-side. Persist them through the per-user settings store (no schema change; the settings table takes arbitrary keys) and migrate any existing localStorage values on first load so users keep their picks. dashboard_timezones is left unset by default so the widget can tell 'never chosen' from an explicitly emptied list.
This commit is contained in:
Maurice
2026-06-27 12:19:40 +02:00
committed by Maurice
parent eb0ab4001d
commit 3554fde8d6
4 changed files with 74 additions and 13 deletions
+4
View File
@@ -41,6 +41,10 @@ export const useSettingsStore = create<SettingsState>((set, get) => ({
maplibre_style: '',
mapbox_3d_enabled: true,
mapbox_quality_mode: false,
dashboard_fx_from: 'EUR',
dashboard_fx_to: 'USD',
// dashboard_timezones is intentionally left unset so the widget can tell "never
// chosen" (fall back to home + defaults) from an explicitly emptied list.
},
isLoaded: false,