test communication scheduler<->simclient
This commit is contained in:
@@ -32,7 +32,6 @@ const sidebarItems = [
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { fetchClientsWithoutDescription } from './apiClients';
|
||||
|
||||
// ENV aus .env holen (Platzhalter, im echten Projekt über process.env oder API)
|
||||
const ENV = import.meta.env.VITE_ENV || 'development';
|
||||
@@ -128,7 +127,6 @@ const Layout: React.FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
function useLoginCheck() {
|
||||
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
||||
|
||||
@@ -150,17 +148,7 @@ const App: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const isLoggedIn = useLoginCheck();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoggedIn) return;
|
||||
fetchClientsWithoutDescription().then(list => {
|
||||
if (list.length > 0) {
|
||||
console.log('[Navigation] Weiterleitung zu /clients wegen fehlender Beschreibung');
|
||||
navigate('/clients');
|
||||
} else {
|
||||
console.log('[Navigation] Dashboard wird angezeigt, alle Clients haben Beschreibung');
|
||||
}
|
||||
});
|
||||
}, [isLoggedIn, navigate]);
|
||||
// Automatische Navigation zu /clients bei leerer Beschreibung entfernt
|
||||
|
||||
return (
|
||||
<ToastProvider>
|
||||
|
||||
Reference in New Issue
Block a user