fix naming on variable
fix tapping on exercise not updating external correctly
This commit is contained in:
Trey t
2024-08-28 08:55:41 -05:00
parent bfb373c8af
commit 2d5d55c272
14 changed files with 51 additions and 55 deletions

View File

@@ -37,13 +37,13 @@ struct AllWorkoutsView: View {
@State private var showWorkoutDetail = false
@State private var selectedWorkout: Workout? {
didSet {
bridgeModule.currentExerciseInfo.workout = selectedWorkout
bridgeModule.currentWorkoutInfo.workout = selectedWorkout
}
}
@State private var selectedPlannedWorkout: Workout? {
didSet {
bridgeModule.currentExerciseInfo.workout = selectedPlannedWorkout
bridgeModule.currentWorkoutInfo.workout = selectedPlannedWorkout
}
}
@@ -60,7 +60,7 @@ struct AllWorkoutsView: View {
AllWorkoutPickerView(mainViews: MainViewTypes.allCases,
selectedSegment: $selectedSegment,
showCurrentWorkout: {
selectedWorkout = bridgeModule.currentExerciseInfo.workout
selectedWorkout = bridgeModule.currentWorkoutInfo.workout
})
@@ -94,7 +94,7 @@ struct AllWorkoutsView: View {
maybeUpdateShit()
}
.sheet(item: $selectedWorkout) { item in
let isPreview = item.id == bridgeModule.currentExerciseInfo.workout?.id
let isPreview = item.id == bridgeModule.currentWorkoutInfo.workout?.id
let viewModel = WorkoutDetailViewModel(workout: item, isPreview: isPreview)
WorkoutDetailView(viewModel: viewModel)
}