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:
parent
e74d1a4b26
commit
2d5e5186f7
@ -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
|
||||
// Hide splash screen safely (only once)
|
||||
if (!splashHidden) {
|
||||
splashHidden = true;
|
||||
SplashScreen.hideAsync().catch(() => {});
|
||||
}
|
||||
|
||||
const inAuthGroup = segments[0] === '(auth)';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user