Skip to content

Commit

Permalink
fix: import splash screen from router (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoGlastra authored Sep 22, 2023
1 parent bf4914a commit 69186d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import { Provider } from 'app/provider'
import { NoInternetToastProvider } from 'app/provider/NoInternetToastProvider'
import { isAndroid } from 'app/utils/platform'
import { useFonts } from 'expo-font'
import { Stack } from 'expo-router'
import * as SplashScreen from 'expo-splash-screen'
import { Stack, SplashScreen } from 'expo-router'
import { useEffect, useState } from 'react'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

Expand Down Expand Up @@ -101,7 +100,9 @@ export default function HomeLayout() {

// Hide splash screen when agent and fonts are loaded or agent could not be initialized
useEffect(() => {
if (fontLoaded && (agent || agentInitializationFailed)) void SplashScreen.hideAsync()
if (fontLoaded && (agent || agentInitializationFailed)) {
void SplashScreen.hideAsync()
}
}, [fontLoaded, agent, agentInitializationFailed])

// Show error screen if agent could not be initialized
Expand Down

0 comments on commit 69186d2

Please sign in to comment.