From 23e9e9839f90315a7644754de674f04a5097eb24 Mon Sep 17 00:00:00 2001 From: frakarr Date: Fri, 12 Dec 2025 00:00:13 +0100 Subject: [PATCH] Update Settings.tsx --- pages/Settings.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pages/Settings.tsx b/pages/Settings.tsx index a2add19..2b7d3ba 100644 --- a/pages/Settings.tsx +++ b/pages/Settings.tsx @@ -16,7 +16,7 @@ export const SettingsPage: React.FC = () => { const isPrivileged = currentUser?.role === 'admin' || currentUser?.role === 'poweruser'; // Tab configuration - type TabType = 'profile' | 'features' | 'general' | 'condos' | 'families' | 'users' | 'notices' | 'alerts' | 'storage'; + type TabType = 'profile' | 'features' | 'general' | 'storage' | 'condos' | 'families' | 'users' | 'notices' | 'alerts'; const [activeTab, setActiveTab] = useState(isPrivileged ? 'general' : 'profile'); const [loading, setLoading] = useState(true); @@ -138,6 +138,11 @@ export const SettingsPage: React.FC = () => { const activeC = await CondoService.getActiveCondo(); const gSettings = await CondoService.getSettings(); + // Ensure storageConfig exists locally even if API missed it + if (!gSettings.storageConfig) { + gSettings.storageConfig = { provider: 'local_db' }; + } + setCondos(condoList); setActiveCondo(activeC); setGlobalSettings(gSettings); @@ -571,7 +576,8 @@ export const SettingsPage: React.FC = () => { } if (isPrivileged) { tabs.push( - { id: 'general', label: 'Condominio', icon: } + { id: 'general', label: 'Condominio', icon: }, + { id: 'storage', label: 'Cloud & Storage', icon: } // Moved up here ); if (globalSettings?.features.multiCondo) { tabs.push({ id: 'condos', label: 'Lista Condomini', icon: }); @@ -584,8 +590,7 @@ export const SettingsPage: React.FC = () => { tabs.push({ id: 'notices', label: 'Bacheca', icon: }); } tabs.push( - { id: 'alerts', label: 'Avvisi Email', icon: }, - { id: 'storage', label: 'Cloud & Storage', icon: } + { id: 'alerts', label: 'Avvisi Email', icon: } ); }