From 48da18766084c788e53964a18caefcac8e763134 Mon Sep 17 00:00:00 2001 From: AG Date: Fri, 12 Dec 2025 21:01:45 +0200 Subject: [PATCH] Stay on the view after page reload --- src/App.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ; }