From a9226a5cc1b1ca0c481cf3cd13ab9d77aa120610 Mon Sep 17 00:00:00 2001 From: Samet Alan Date: Mon, 16 Dec 2024 18:12:18 +0300 Subject: [PATCH] fix Training page require reload to progress --- frontend/src/components/Detailed_Ex_Modal.component.jsx | 1 + frontend/src/components/Training.component.jsx | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/src/components/Detailed_Ex_Modal.component.jsx b/frontend/src/components/Detailed_Ex_Modal.component.jsx index 9785ed5..4e62953 100644 --- a/frontend/src/components/Detailed_Ex_Modal.component.jsx +++ b/frontend/src/components/Detailed_Ex_Modal.component.jsx @@ -149,6 +149,7 @@ const DetailedExModal = ({ isOpen, onClose, data, setData, excersizeID }) => { return { ...exercise, completedAt: new Date().toISOString(), // Mark as completed + completedSets: parsedSetInputs, }; } return exercise; diff --git a/frontend/src/components/Training.component.jsx b/frontend/src/components/Training.component.jsx index 681fa11..c996034 100644 --- a/frontend/src/components/Training.component.jsx +++ b/frontend/src/components/Training.component.jsx @@ -256,18 +256,14 @@ const TrainingCard = () => { onWorkoutOpen(); }; - console.log(isUserJoined); - // Add a new utility function to check workout completion const isWorkoutComplete = (workout) => { return workout.workoutExercises.every(exercise => exercise.completedAt !== null); }; - // Add a new utility function to check week completion const isWeekComplete = (week) => { return week.workouts.every(workout => isWorkoutComplete(workout)); }; - return (