diff --git a/src/Components/LoginChecker/LoginChecker.tsx b/src/Components/LoginChecker/LoginChecker.tsx index c99bee3..07d8bed 100644 --- a/src/Components/LoginChecker/LoginChecker.tsx +++ b/src/Components/LoginChecker/LoginChecker.tsx @@ -11,7 +11,8 @@ export default function LoginChecker() { const old_session_checked = useSelector( (state: OldSessionState) => state.old_session_checked.value ); - if (!logged_in && old_session_checked) { + if (!logged_in && !old_session_checked) { + } else if (!logged_in && old_session_checked) { console.log("Not logged in. Redirecting to login page"); return ; } diff --git a/src/Routes/Dashboard/Dashboard.tsx b/src/Routes/Dashboard/Dashboard.tsx index adc18dc..4cc1474 100644 --- a/src/Routes/Dashboard/Dashboard.tsx +++ b/src/Routes/Dashboard/Dashboard.tsx @@ -17,7 +17,34 @@ export default function Dashboard() { const logs = useQuery("logs", GetLogs, { retry: 0 }); const products = useQuery("products", GetProducts, { retry: 0 }); if (logs.isLoading && products.isLoading) { - return
heh
; + return ( +
+ +
+ +

Dashboard

+
+
+

+ Loading dashboard... +

+
+
+ ); + } + if (logs.error || products.error) { +
+ +
+ +

Dashboard

+
+
+

+ Error loading dashboard +

+
+
; } return (