From ca15611e0f0cde9b568f9a93a9266d7a7cec49f2 Mon Sep 17 00:00:00 2001 From: Baptiste Marcel Date: Tue, 5 Dec 2023 11:41:15 +0100 Subject: [PATCH] =?UTF-8?q?correctif=20suppression=20du=20compte=20(correc?= =?UTF-8?q?tif=20et=20d=C3=A9connexion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cryptide_project/src/Pages/Profile.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index bcaf8c6..dfcc5b1 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -1,11 +1,8 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import ProfilePDP from '../Components/ProfilePDP'; import SessionService from '../services/SessionService'; import AuthService from '../services/AuthService'; -import { PlayerProps } from '../types/Player'; -import { delay, set, update } from 'lodash'; -import { socket } from '../SocketConfig'; /* Style */ @@ -17,9 +14,6 @@ import Cancel from '../res/icon/cancel.png' /* Nav */ import { useNavigate } from 'react-router-dom'; -/* Model */ -import User from '../model/User'; - /* Context */ import { useAuth } from '../Contexts/AuthContext'; @@ -180,16 +174,15 @@ const Profile = () => { if(user!= null){ const pseudo = user.pseudo; - AuthService.delAccount(pseudo); - AuthService.logout(); logout(); + AuthService.delAccount(pseudo); } else{ console.error("l'utilisateur ne peut pas ĂȘtre null") } handleCloseDeleteModal(); - navigate("/play") + navigate("/") } else { console.error('Phrase de confirmation incorrecte.');