diff --git a/src/App.tsx b/src/App.tsx index 8e81ea1..764acf8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,7 +13,7 @@ import { getSystemLanguage } from './services/i18n'; import { useAuth } from './context/AuthContext'; function App() { - const { currentUser, updateUser, logout } = useAuth(); + const { currentUser, updateUser, logout, isLoading } = useAuth(); const [language, setLanguage] = useState('en'); const navigate = useNavigate(); @@ -37,6 +37,14 @@ function App() { navigate('/login'); }; + if (isLoading) { + return ( +
+
Loading...
+
+ ); + } + if (!currentUser && location.pathname !== '/login') { return ; }