From fae99f6a407de70fdba6029e45c194fb241c3433 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sat, 3 Aug 2024 18:59:56 +0530 Subject: Fixed routing issue with POPUP --- panel/src/contexts/AuthContext.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'panel/src/contexts') diff --git a/panel/src/contexts/AuthContext.jsx b/panel/src/contexts/AuthContext.jsx index cf8c7b5..f4f9383 100644 --- a/panel/src/contexts/AuthContext.jsx +++ b/panel/src/contexts/AuthContext.jsx @@ -10,10 +10,12 @@ export const useAuth = () => { export const AuthProvider = ({ children }) => { const [currentUser, setCurrentUser] = useState(null); + const [loading, setLoading] = useState(true); useEffect(() => { const unsubscribe = onAuthStateChanged(auth, (user) => { setCurrentUser(user); + setLoading(false); }); return unsubscribe; @@ -23,5 +25,9 @@ export const AuthProvider = ({ children }) => { currentUser, }; - return {children}; + return ( + + {!loading && children} + + ); }; -- cgit v1.2.3-59-g8ed1b