diff --git a/src/App.js b/src/App.js index 9824feb..5f09dda 100644 --- a/src/App.js +++ b/src/App.js @@ -2658,13 +2658,21 @@ function App() { } catch (err) { console.error("Authentication error:", err); setError("Failed to authenticate. Please try again later."); + // Auth failed and onAuthStateChanged won't fire with a user, so unblock the UI here + setIsAuthReady(true); + setIsLoading(false); } }; const unsubscribe = onAuthStateChanged(auth, (user) => { setUserId(user ? user.uid : null); - setIsAuthReady(true); - setIsLoading(false); + // Only mark auth ready once we have an actual authenticated user. + // onAuthStateChanged fires with null before signInAnonymously completes, + // which would cause Firestore queries to run unauthenticated. + if (user) { + setIsAuthReady(true); + setIsLoading(false); + } }); initAuth();