diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 104c7ce..876d91f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -19,6 +19,7 @@ function App() { const [isLoggedIn, setIsLoggedIn] = useState(false); const [userId, setUserId] = useState(null); const [username, setUsername] = useState(null); + const [isLoading, setIsLoading] = useState(true); useEffect(() => { fetch("/api/user/login_status") @@ -31,9 +32,16 @@ function App() { .catch((error) => { console.error("Error fetching login status:", error); setIsLoggedIn(false); + }) + .finally(() => { + setIsLoading(false); }); }, []); + if (isLoading) { + return
Loading...
; + } + return (