feat: prefered language

This commit is contained in:
2026-08-11 14:45:22 +02:00
parent 1de35c4e43
commit 7dbe60f500
2 changed files with 16 additions and 22 deletions
+2 -7
View File
@@ -87,9 +87,7 @@ export default function LandingPage() {
continuationHandledRef.current = true
const nextVideoUrl =
Platform.OS === 'web'
? welcomeVideo?.registrationIntroWeb
: welcomeVideo?.registrationIntro
Platform.OS === 'web' ? welcomeVideo?.registrationIntroWeb : welcomeVideo?.registrationIntro
if (typeof nextVideoUrl === 'string' && nextVideoUrl.trim().length > 0) {
setVideoUrl(nextVideoUrl)
@@ -102,10 +100,7 @@ export default function LandingPage() {
return (
<>
<EntryJingle active={!isAuthenticated && !selectedLanguage} />
<Page
title="Landing Page"
backgroundImg={background.homeBGWeb}
>
<Page title="Landing Page" backgroundImg={background.homeBGWeb}>
<View
style={{
flex: 1,
+14 -15
View File
@@ -16,14 +16,24 @@ export default ({ navigation }) => {
}, [])
const userRouting = async () => {
try {
const uid = firebase.auth().currentUser?.uid
if (!uid) throw new Error('No user')
const uid = firebase.auth().currentUser?.uid
if (!uid) {
navigation.reset({
index: 0,
routes: [{ name: Routes.LandingPage }],
})
setIsFullyLoaded(true)
return
}
try {
const userSnap = await usersRef.doc(uid).get()
const user = userSnap?.data() || {}
if (userSnap.exists) setCurrentUserData(user)
} catch (error) {
console.warn('Splash: unable to load user profile', error)
} finally {
navigation.reset({
index: 0,
routes: [
@@ -36,17 +46,6 @@ export default ({ navigation }) => {
},
],
})
} catch (error) {
// Pas d'utilisateur connecté => accueil avec tab bar
navigation.reset({
index: 0,
routes: [
{
name: Routes.BottomTab,
},
],
})
} finally {
setIsFullyLoaded(true)
}
}