diff --git a/app/(protected)/automation/index.tsx b/app/(protected)/automation/index.tsx
index 923ca8d..6483033 100644
--- a/app/(protected)/automation/index.tsx
+++ b/app/(protected)/automation/index.tsx
@@ -71,43 +71,6 @@ export default function AutomationScreen() {
return ;
}
- // TODO: Remove duplicated code
- if (!connectionStatus.success) {
- return (
-
-
-
-
-
- Domotica
- Controlla gli ambienti
-
-
-
- {connectionStatus.success ? 'ONLINE' : 'OFFLINE'}
-
-
-
-
-
-
- }
- >
-
- Errore di connessione
-
- {connectionStatus.message}
-
-
- Riprova
-
-
-
- );
- }
-
return (
@@ -140,11 +103,22 @@ export default function AutomationScreen() {
}
>
- {filteredAreas.length > 0 ? (
+ {!connectionStatus.success ? (
+ <>
+
+ Errore di connessione
+
+ {connectionStatus.message}
+
+
+ Riprova
+
+ >
+ ) : filteredAreas.length > 0 ? (
{filteredAreas.map((area, index) => {
const { icon: IconComponent, bgColor } = AREA_STYLES[index % AREA_STYLES.length];