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
+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)
}
}