From 48505fe3b553e7950deed4048985367acec778ed Mon Sep 17 00:00:00 2001 From: rafael Date: Sat, 22 Nov 2025 22:16:24 -0400 Subject: [PATCH] Update `SettingsPage` to replace notifications with language preference Replaced the deprecated notifications option with a language selector in `SettingsPage`. Updated localStorage parsing to strip deprecated fields and added UI support for the new language preference. --- src/components/Settings/SettingsPage.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/Settings/SettingsPage.js b/src/components/Settings/SettingsPage.js index 26b8072..9dc8a64 100644 --- a/src/components/Settings/SettingsPage.js +++ b/src/components/Settings/SettingsPage.js @@ -5,7 +5,7 @@ import '../../styles/components.css'; const DEFAULT_SETTINGS = { timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC', theme: 'light', - notifications: true, + language: 'es', apiBaseUrl: '' }; @@ -14,7 +14,9 @@ const loadSettings = () => { const raw = localStorage.getItem('app_settings'); if (!raw) return DEFAULT_SETTINGS; const parsed = JSON.parse(raw); - return { ...DEFAULT_SETTINGS, ...parsed }; + // Strip deprecated fields like 'notifications' if present in older storage + const { notifications, ...rest } = parsed || {}; + return { ...DEFAULT_SETTINGS, ...rest }; } catch { return DEFAULT_SETTINGS; } @@ -99,15 +101,11 @@ const SettingsPage = () => {
- + +