diff --git a/app/_layout.tsx b/app/_layout.tsx index 138c112..eebc444 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -15,7 +15,11 @@ import { useColorScheme } from '@/hooks/use-color-scheme'; // Stripe publishable key (test mode) - must match backend STRIPE_PUBLISHABLE_KEY const STRIPE_PUBLISHABLE_KEY = 'pk_test_51P3kdqP0gvUw6M9C7ixPQHqbPcvga4G5kAYx1h6QXQAt1psbrC2rrmOojW0fTeQzaxD1Q9RKS3zZ23MCvjjZpWLi00eCFWRHMk'; -SplashScreen.preventAutoHideAsync(); +// Prevent auto-hide, ignore errors if splash not available +SplashScreen.preventAutoHideAsync().catch(() => {}); + +// Track if splash screen was hidden to prevent double-hiding +let splashHidden = false; function RootLayoutNav() { const colorScheme = useColorScheme(); @@ -39,8 +43,11 @@ function RootLayoutNav() { return; } - // Hide splash screen safely - SplashScreen.hideAsync().catch(() => { }); + // Hide splash screen safely (only once) + if (!splashHidden) { + splashHidden = true; + SplashScreen.hideAsync().catch(() => {}); + } const inAuthGroup = segments[0] === '(auth)';