diff --git a/app.config.ts b/app.config.ts index 549189d..61554ff 100644 --- a/app.config.ts +++ b/app.config.ts @@ -33,6 +33,11 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ icon: './assets/icon.png', userInterfaceStyle: 'automatic', newArchEnabled: true, + splash: { + image: './assets/adaptive-icon.png', + resizeMode: 'contain', + backgroundColor: '#2484c4', + }, updates: { fallbackToCacheTimeout: 0, }, diff --git a/src/app/(app)/_layout.tsx b/src/app/(app)/_layout.tsx index cd8220e..bb20095 100644 --- a/src/app/(app)/_layout.tsx +++ b/src/app/(app)/_layout.tsx @@ -60,24 +60,6 @@ export default function TabLayout() { const lastSignedInStatus = useRef(null); const parentRef = useRef(null); - const hideSplash = useCallback(async () => { - if (hasHiddenSplash.current) return; - - try { - await SplashScreen.hideAsync(); - hasHiddenSplash.current = true; - logger.info({ - message: 'Splash screen hidden', - context: { status }, - }); - } catch (error) { - logger.error({ - message: 'Failed to hide splash screen', - context: { error, status }, - }); - } - }, [status]); - // Initialize push notifications usePushNotifications(); @@ -164,31 +146,6 @@ export default function TabLayout() { hasInitialized: hasInitialized.current, }); - // Handle splash screen hiding - only hide when auth status is settled - useEffect(() => { - logger.info({ - message: 'Splash screen effect triggered', - context: { status, hasHiddenSplash: hasHiddenSplash.current }, - }); - - // Only hide splash when status is settled (not 'idle' or 'loading') - if (status === 'signedIn' || status === 'signedOut' || status === 'onboarding') { - logger.info({ - message: 'Auth status settled, hiding splash screen', - context: { status }, - }); - - // Add debounce to smooth rendering on slow devices - const splashTimeout = setTimeout(() => { - hideSplash(); - }, 200); // 200ms debounce for optimal performance - - return () => { - clearTimeout(splashTimeout); - }; - } - }, [status, hideSplash]); - // Handle app initialization - simplified logic useEffect(() => { const shouldInitialize = status === 'signedIn' && !hasInitialized.current && !isInitializing.current && lastSignedInStatus.current !== 'signedIn'; diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index 876f65f..4e654d0 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -33,7 +33,7 @@ import { uuidv4 } from '@/lib/utils'; import { appInitializationService } from '@/services/app-initialization.service'; // Prevent the splash screen from auto-hiding before asset loading is complete. -SplashScreen.preventAutoHideAsync(); +//SplashScreen.preventAutoHideAsync(); export { ErrorBoundary } from 'expo-router'; export const navigationRef = createNavigationContainerRef();