diff --git a/web/src/stores/workout.ts b/web/src/stores/workout.ts index 767e2412..56ea0f73 100644 --- a/web/src/stores/workout.ts +++ b/web/src/stores/workout.ts @@ -56,20 +56,12 @@ export const useWorkoutStore = defineStore( } } - const deleteSet = (routineID: RoutineID, exerciseID: ExerciseID, setIndex: number) => { - if (!workouts.value[routineID]) { - return - } - - if (!workouts.value[routineID].exerciseSets) { - return - } - - if (!workouts.value[routineID].exerciseSets[exerciseID]) { - return - } + const deleteSet = (routineID: RoutineID, exerciseID: ExerciseID, index: number) => { + if (!workouts.value[routineID]) return + if (!workouts.value[routineID].exerciseSets) return + if (!workouts.value[routineID].exerciseSets[exerciseID]) return - workouts.value[routineID].exerciseSets[exerciseID].splice(setIndex, 1) + workouts.value[routineID].exerciseSets[exerciseID].splice(index, 1) } const removeWorkout = (routineID: RoutineID) => { diff --git a/web/src/ui/workouts/StartWorkout.vue b/web/src/ui/workouts/StartWorkout.vue index 30099165..9e10c630 100644 --- a/web/src/ui/workouts/StartWorkout.vue +++ b/web/src/ui/workouts/StartWorkout.vue @@ -10,7 +10,6 @@ import { useWorkoutStore } from '@/stores/workout' import AppList from '@/ui/components/AppList.vue' import { usePageTitleStore } from '@/stores/pageTitle' import AppButton from '@/ui/components/AppButton.vue' -import AppListItem from '@/ui/components/AppListItem.vue' import { MinusCircleIcon } from '@heroicons/vue/24/outline' import { type Routine } from '@/proto/api/v1/routine_service_pb' import AppListItemInput from '@/ui/components/AppListItemInput.vue' @@ -113,12 +112,12 @@ const cancelWorkout = async () => { const prevSetWeight = (exerciseID: string, index: number) => { const prevSet = prevExerciseSets.value.find((set) => set.exercise?.id === exerciseID)?.sets[index] - return prevSet?.weight?.toString() || 'Weight' + return prevSet?.weight?.toString() } const prevSetReps = (exerciseID: string, index: number) => { const prevSet = prevExerciseSets.value.find((set) => set.exercise?.id === exerciseID)?.sets[index] - return prevSet?.reps?.toString() || 'Reps' + return prevSet?.reps?.toString() } const isNumber = (value: number | string | undefined) => { @@ -151,48 +150,63 @@ const setEndDateTime = (value: string) => {