Skip to content

Commit

Permalink
fixbug
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoldch committed Mar 15, 2024
1 parent 7d754e4 commit 2b4776f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/components/TableData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Stats from "./Stats";
import ModalSuccess from "./ModalSuccess";
import ModalFailed from "./ModalFailed";
import TableSelectedItems from "./TableSelectedItems";
import { LucideArrowUpRightFromSquare } from 'lucide-react';



Expand Down Expand Up @@ -53,8 +54,11 @@ function TableData() {
const [supp, setSuppr] = useState('Date de suppression');


console.log(isAuthenticated)
console.log(userId)


useEffect(() => {
// actualiser userID
}, []);



Expand Down
6 changes: 3 additions & 3 deletions src/context/UserContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ useEffect(() => {
const token = localStorage.getItem('token');
const user_id = sessionStorage.getItem('user_id');
if (user_id) {
setUserId(user_id);
console.log(user_id)
setUserId(parseInt(user_id));
//console.log(userId === 2)
setIsLoading(false);
} else if(token){
getUserId(token).then((valid) => {
setUserId(valid);
setUserId(parseInt(valid));
setIsLoading(false);
}).catch((error) => {
console.error('Erreur lors de la vérification du token:', error);
Expand Down

0 comments on commit 2b4776f

Please sign in to comment.