From cfbe4cc3898e6e8ba32cf3028f4a1578ee11fdda Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Tue, 23 Sep 2025 10:23:44 +0200 Subject: [PATCH] Fix jwt-token --- client/src/App.jsx | 7 ++++++- client/src/pages/Alerts.jsx | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/App.jsx b/client/src/App.jsx index 45c40b5..cc30a89 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -15,6 +15,7 @@ import Settings from './pages/Settings'; import Login from './pages/Login'; import Register from './pages/Register'; import ProtectedRoute from './components/ProtectedRoute'; +import ErrorBoundary from './components/ErrorBoundary'; function App() { return ( @@ -72,7 +73,11 @@ function App() { } /> } /> } /> - } /> + + + + } /> } /> } /> diff --git a/client/src/pages/Alerts.jsx b/client/src/pages/Alerts.jsx index e285211..f8a4308 100644 --- a/client/src/pages/Alerts.jsx +++ b/client/src/pages/Alerts.jsx @@ -63,6 +63,16 @@ const Alerts = () => { // Show loading if either alerts or drone types are loading const isLoading = loading || droneTypesLoading; + // DEBUG: Validate state integrity + useEffect(() => { + console.log('DEBUG: Alerts state check', { + alertRules: alertRules?.length, + alertLogs: alertLogs?.length, + alertStats: alertStats ? 'present' : 'null', + invalidRules: alertRules?.filter(rule => typeof rule.alert_channels === 'object' && !Array.isArray(rule.alert_channels)) + }); + }, [alertRules, alertLogs, alertStats]); + // Group alerts by alert_event_id to show related alerts together const groupAlertsByEvent = (logs) => { const grouped = {};