From 74e00a157ba0b0cb50e39a1e4458e234b2bc68b6 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 22 Nov 2022 16:08:17 +0100 Subject: [PATCH] Ajout: Ajout de la partie changement mdp --- bob_party/src/screens/Settings.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bob_party/src/screens/Settings.tsx b/bob_party/src/screens/Settings.tsx index a198c46..c406b35 100644 --- a/bob_party/src/screens/Settings.tsx +++ b/bob_party/src/screens/Settings.tsx @@ -35,6 +35,13 @@ function Settings(props: { navigation: any; }) { MANAGER_USER.getsaverUser().updateUser(MANAGER_USER.getCurrentUser()); } + function changePassword(password:string){ + MANAGER_USER.getCurrentUser()?.setPassword(password); + console.log(MANAGER_USER.getCurrentUser()?.getPassword()); + setUser(MANAGER_USER.getCurrentUser()); + MANAGER_USER.getsaverUser().updateUser(MANAGER_USER.getCurrentUser()); + } + const dispatch=useDispatch(); return ( @@ -82,7 +89,7 @@ function Settings(props: { navigation: any; }) { isDialogVisible={dialogPasswordVisible} title="Inserer le nouveau mot de passe" hintInput ="Mot de passe" - submitInput={ (inputText: string) => { setDialogPasswordVisible(false)} } + submitInput={ (inputText: string) => { changePassword(inputText); setDialogPasswordVisible(false)} } closeDialog={ () => {setDialogPasswordVisible(false)}}>