Workout Management tests done

This commit is contained in:
AG
2025-12-09 18:11:55 +02:00
parent f32661d892
commit 2352ac04d6
14 changed files with 557 additions and 67 deletions

View File

@@ -20,7 +20,7 @@ interface PlansProps {
const Plans: React.FC<PlansProps> = ({ lang }) => {
const { currentUser } = useAuth();
const userId = currentUser?.id || '';
const { plans, savePlan, deletePlan } = useSession();
const { plans, savePlan, deletePlan, refreshData } = useSession();
const { startSession } = useActiveWorkout();
const [isEditing, setIsEditing] = useState(false);
@@ -45,6 +45,7 @@ const Plans: React.FC<PlansProps> = ({ lang }) => {
useEffect(() => {
const loadData = async () => {
refreshData();
const fetchedExercises = await getExercises(userId);
// Filter out archived exercises
if (Array.isArray(fetchedExercises)) {
@@ -54,7 +55,7 @@ const Plans: React.FC<PlansProps> = ({ lang }) => {
}
};
if (userId) loadData();
}, [userId]);
}, [userId, refreshData]);
const handleCreateNew = () => {
setEditId(generateId());