fix(auth): show splash screen during auth check to prevent login flash (#27022)

This commit is contained in:
Dhairyashil Shinde
2026-01-19 21:13:33 +01:00
committed by GitHub
parent ad137fbf9c
commit 12e42427e2
+19 -1
View File
@@ -2,6 +2,7 @@ import { PortalHost } from "@rn-primitives/portal";
import { isLiquidGlassAvailable } from "expo-glass-effect";
import { Stack } from "expo-router";
import { Platform, StatusBar, View } from "react-native";
import { CalComLogo } from "@/components/CalComLogo";
import LoginScreenComponent from "@/components/LoginScreen";
import { NetworkStatusBanner } from "@/components/NetworkStatusBanner";
import { GlobalToast } from "@/components/ui/GlobalToast";
@@ -11,7 +12,24 @@ import { ToastProvider } from "@/contexts/ToastContext";
import "../global.css";
function RootLayoutContent() {
const { isAuthenticated } = useAuth();
const { isAuthenticated, loading } = useAuth();
// Show Cal.com logo while checking auth state to prevent login flash
if (loading) {
return (
<View
style={{
flex: 1,
backgroundColor: "#FFFFFF",
justifyContent: "center",
alignItems: "center",
}}
>
<StatusBar barStyle="dark-content" backgroundColor="#ffffff" />
<CalComLogo width={120} height={26} />
</View>
);
}
const content = isAuthenticated ? (
<Stack>