firtname and lastname before username
This commit is contained in:
@@ -20,7 +20,7 @@ import { background } from "../assets";
|
||||
import GradientButton from "../components/GradientButton.js";
|
||||
import { Input } from "../components/Input.js";
|
||||
import ItemContainer from "../components/ItemContainer/ItemContainer";
|
||||
import firebase, { usersRef } from "../config/firebase";
|
||||
import firebase from "../config/firebase";
|
||||
import {
|
||||
GOOGLE_ANDROID_CLIENT_ID,
|
||||
GOOGLE_IOS_CLIENT_ID,
|
||||
@@ -63,13 +63,7 @@ export default ({ navigation }) => {
|
||||
const afterLoginNavigate = async () => {
|
||||
const uid = firebase.auth().currentUser?.uid;
|
||||
if (!uid) throw new Error("Aucun utilisateur après connexion");
|
||||
const snap = await usersRef.doc(uid).get();
|
||||
const hasUserName = !!snap.data()?.userName;
|
||||
if (hasUserName) {
|
||||
navigation.reset({ index: 0, routes: [{ name: Routes.BottomTab }] });
|
||||
} else {
|
||||
navigation.reset({ index: 0, routes: [{ name: Routes.CreatePseudo }] });
|
||||
}
|
||||
navigation.reset({ index: 0, routes: [{ name: Routes.BottomTab }] });
|
||||
};
|
||||
|
||||
const onLogin = async () => {
|
||||
|
||||
Reference in New Issue
Block a user