Skip to content

Commit

Permalink
Merge pull request #356 from bounswe/issue#355
Browse files Browse the repository at this point in the history
fix Training page require reload to progress
  • Loading branch information
sametaln authored Dec 16, 2024
2 parents 10dbfe9 + a9226a5 commit fd5cc8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/Detailed_Ex_Modal.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ const DetailedExModal = ({ isOpen, onClose, data, setData, excersizeID }) => {
return {
...exercise,
completedAt: new Date().toISOString(), // Mark as completed
completedSets: parsedSetInputs,
};
}
return exercise;
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/components/Training.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="w-full max-w-[60%] mx-auto p-4 bg-white shadow-lg rounded-lg text-sm">

Expand Down

0 comments on commit fd5cc8b

Please sign in to comment.