diff --git a/App.tsx b/App.tsx index 28169f5..6537d42 100644 --- a/App.tsx +++ b/App.tsx @@ -43,6 +43,7 @@ const App: React.FC = () => { const [sessions, setSessions] = useState([]); const [currentSessionId, setCurrentSessionId] = useState(null); const [isLoading, setIsLoading] = useState(false); + const [isLoggingIn, setIsLoggingIn] = useState(false); const [isFaqGenerating, setIsFaqGenerating] = useState(false); const [generatingStatus, setGeneratingStatus] = useState(''); const [isSyncing, setIsSyncing] = useState(false); @@ -96,6 +97,7 @@ const App: React.FC = () => { }, [personas]); const handleLogin = (email: string) => { + setIsLoggingIn(true); // If we have users loaded (from NC or Init), check them const user = users.find(u => u.email.toLowerCase() === email.toLowerCase() && u.status === 'aktiv'); if (user) { @@ -103,6 +105,7 @@ const App: React.FC = () => { } else { alert("Zugang verweigert. Nur verifizierte Wohnpro-Bewohner können sich im Wohnpro Guide anmelden."); } + setIsLoggingIn(false); }; const sendMessage = async (text: string) => { @@ -256,7 +259,7 @@ const App: React.FC = () => { Synchronisiere mit Nextcloud... )} - + ); } diff --git a/components/LoginView.tsx b/components/LoginView.tsx index a7c3c0b..2b380ae 100644 --- a/components/LoginView.tsx +++ b/components/LoginView.tsx @@ -5,9 +5,10 @@ import { User } from '../types'; interface LoginViewProps { onLogin: (email: string) => void; error?: string; + isLoading: boolean; } -const LoginView: React.FC = ({ onLogin, error: externalError }) => { +const LoginView: React.FC = ({ onLogin, error: externalError, isLoading }) => { const [email, setEmail] = useState(''); const [error, setError] = useState(externalError || ''); @@ -48,9 +49,17 @@ const LoginView: React.FC = ({ onLogin, error: externalError })