Fix SplashScreen warning on subscription flow

- Add splashHidden flag to prevent double-hiding splash screen
- Add .catch() to preventAutoHideAsync to handle edge cases
- Fixes "No native splash screen registered" warning

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Sergei 2026-01-09 19:21:53 -08:00
parent e74d1a4b26
commit 2d5e5186f7

View File

@ -15,7 +15,11 @@ import { useColorScheme } from '@/hooks/use-color-scheme';
// Stripe publishable key (test mode) - must match backend STRIPE_PUBLISHABLE_KEY // Stripe publishable key (test mode) - must match backend STRIPE_PUBLISHABLE_KEY
const STRIPE_PUBLISHABLE_KEY = 'pk_test_51P3kdqP0gvUw6M9C7ixPQHqbPcvga4G5kAYx1h6QXQAt1psbrC2rrmOojW0fTeQzaxD1Q9RKS3zZ23MCvjjZpWLi00eCFWRHMk'; 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() { function RootLayoutNav() {
const colorScheme = useColorScheme(); const colorScheme = useColorScheme();
@ -39,8 +43,11 @@ function RootLayoutNav() {
return; return;
} }
// Hide splash screen safely // Hide splash screen safely (only once)
SplashScreen.hideAsync().catch(() => { }); if (!splashHidden) {
splashHidden = true;
SplashScreen.hideAsync().catch(() => {});
}
const inAuthGroup = segments[0] === '(auth)'; const inAuthGroup = segments[0] === '(auth)';