Exercises management fixed

This commit is contained in:
AG
2025-11-25 22:53:41 +02:00
parent fe2883608c
commit e3efc84250
2 changed files with 5 additions and 5 deletions

View File

@@ -70,7 +70,7 @@ const Tracker: React.FC<TrackerProps> = ({ userId, userWeight, activeSession, ac
useEffect(() => {
const loadData = async () => {
const exList = await getExercises(userId);
setExercises(exList.filter(e => !e.isArchived));
setExercises(exList.filter(e => !e.isArchived || (activePlan && activePlan.steps.some(s => s.exerciseId === e.id))));
const planList = await getPlans(userId);
setPlans(planList);
@@ -81,7 +81,7 @@ const Tracker: React.FC<TrackerProps> = ({ userId, userWeight, activeSession, ac
}
};
loadData();
}, [activeSession, userId, userWeight]);
}, [activeSession, userId, userWeight, activePlan]);
// Timer Logic
useEffect(() => {
@@ -115,7 +115,7 @@ const Tracker: React.FC<TrackerProps> = ({ userId, userWeight, activeSession, ac
}
}
}
}, [activeSession, activePlan, currentStepIndex, exercises]);
}, [activeSession, activePlan, currentStepIndex, exercises, selectedExercise]);
useEffect(() => {
const updateSelection = async () => {