diff --git a/bob_party/src/screens/Settings.tsx b/bob_party/src/screens/Settings.tsx
index ace321a..733f659 100644
--- a/bob_party/src/screens/Settings.tsx
+++ b/bob_party/src/screens/Settings.tsx
@@ -5,10 +5,6 @@ import stylesScreen from './style/screens.style';
import styles from './style/Settings.style';
import { TopBar } from '../components/TopBar';
import { ButtonGreySmall } from '../components/ButtonGreySmall';
-import { useDispatch, useSelector } from 'react-redux';
-import { RootState } from '../redux/store';
-import Dialog from "react-native-dialog"
-import RNPickerSelect from "react-native-picker-select";
import { PickerGreySmall } from '../components/PickerGreySmall';
import { useUserStore } from '../context/userContext';
import DialogInput from 'react-native-dialog-input';
@@ -17,6 +13,7 @@ import { MANAGER_USER } from '../../appManagers';
function Settings(props: { navigation: any; }) {
const { navigation } = props
+
const setUser = useUserStore((state) => state.setUser);
@@ -51,7 +48,7 @@ function Settings(props: { navigation: any; }) {
async function changeSexe(sexe:string){
let userManager = new UserModificationManager();
let tmp=MANAGER_USER.getCurrentUser();
- if (tmp!=null){
+ if (tmp!=null && sexe != null){
await userManager.changeSexe(tmp, sexe);
setUser(tmp);
MANAGER_USER.setCurrentUser(tmp);
@@ -61,7 +58,7 @@ function Settings(props: { navigation: any; }) {
async function changeNationality(nationality:string){
let userManager = new UserModificationManager();
let tmp=MANAGER_USER.getCurrentUser();
- if (tmp!=null){
+ if (tmp!=null && nationality != null){
await userManager.changeNationality(tmp, nationality);
setUser(tmp);
MANAGER_USER.setCurrentUser(tmp);
@@ -91,11 +88,11 @@ function Settings(props: { navigation: any; }) {
Nationalité: {useUserStore().user?.getNationality()}
- setSelectedNationality(value)} donePress={() => changeNationality(selectedNationality)} values={["Francais", "Anglais"]} />
+ setSelectedNationality(value)} donePress={() => changeNationality(selectedNationality)} values={[ { label: 'France', value: 'Francais(e)' }, { label: 'Royaume-Uni', value: 'Anglais(e)' }, { label: 'Espagne', value: 'Espagnol(e)' }, { label: 'Belgique', value: 'Belge' }, { label: 'Allemagne', value: 'Allemand(e)' }, ]}/>
Sexe: {useUserStore().user?.getSexe()}
- setSelectedSex(value)} donePress={() => changeSexe(selectedSex)} values={["Homme", "Femme", "Autre"]} />
+ setSelectedSex(value)} donePress={() => changeSexe(selectedSex)} values={[ { label: 'Homme', value: 'Homme' }, { label: 'Femme', value: 'Femme' }, {label: 'Autre', value: 'Autre' } ]} />
ID: {useUserStore().user?.getId()}