mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 14:06:27 +00:00
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:
@@ -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,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user