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

@@ -80,7 +80,7 @@ export const useTracker = (props: any) => { // Props ignored/removed
loadQuickLogSession();
};
loadData();
}, [activeSession, userId, userWeight, activePlan]);
}, [activeSession?.id, userId, userWeight, activePlan?.id, isSporadicMode]);
// Function to reload Quick Log session
const loadQuickLogSession = async () => {
@@ -99,7 +99,7 @@ export const useTracker = (props: any) => { // Props ignored/removed
const step = planExec.getCurrentStep();
if (step) {
const exDef = exercises.find(e => e.id === step.exerciseId);
if (exDef) {
if (exDef && selectedExercise?.id !== exDef.id) {
setSelectedExercise(exDef);
}
}
@@ -113,6 +113,7 @@ export const useTracker = (props: any) => { // Props ignored/removed
await form.updateFormFromLastSet(selectedExercise.id, selectedExercise.type, selectedExercise.bodyWeightPercentage);
} else {
setSearchQuery('');
form.resetForm();
}
};
updateSelection();
@@ -155,7 +156,7 @@ export const useTracker = (props: any) => { // Props ignored/removed
setSporadicSuccess(true);
setTimeout(() => setSporadicSuccess(false), 2000);
loadQuickLogSession();
form.resetForm();
// form.resetForm(); // Persist values
refreshHistory();
}
} catch (error) {