-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
32 lines (27 loc) · 958 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import MultiplayerProvider from '@contexts/MultiplayerContext'
import { config } from '@gluestack-ui/config'
import { GluestackUIProvider } from '@gluestack-ui/themed'
import WebLayout from '@layouts/WebLayout'
import { VersionDatabaseService } from '@services/database/version.database'
import { useEffect, useState } from 'react'
import { Platform } from 'react-native'
import 'react-native-gesture-handler'
export default function App() {
// #region States
const [isValidatingVersion, setIsValidatingVersion] = useState(true)
// #endregion
// #region Effects
useEffect(() => {
const versionPromise = VersionDatabaseService.validate()
Promise.allSettled([versionPromise]).then(() => {
setIsValidatingVersion(false)
})
}, [])
// #endregion
if (isValidatingVersion) return <></>
return (
<GluestackUIProvider config={config}>
{Platform.OS === 'web' ? <WebLayout /> : <></>}
</GluestackUIProvider>
)
}