Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import splash screen from router #65

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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