fix(auth): show splash screen during auth check to prevent login flash (#27022)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user