split files up, fix complete workout screen not showing if remove workout details screen

This commit is contained in:
Trey t
2024-06-21 10:41:37 -05:00
parent c101da4a4d
commit 7ce996e451
11 changed files with 441 additions and 358 deletions

View File

@@ -172,6 +172,14 @@ struct WorkoutDetailView: View {
avPlayer.play()
}
}
bridgeModule.completedWorkout = {
if let workoutData = createWorkoutData() {
workoutComplete = .completedWorkout(workoutData)
} else {
bridgeModule.resetCurrentWorkout()
}
}
}
.onReceive(NotificationCenter.default.publisher(
for: UIScene.willEnterForegroundNotification)) { _ in
@@ -194,14 +202,6 @@ struct WorkoutDetailView: View {
}
func startWorkout(workout: Workout) {
bridgeModule.completedWorkout = {
if let workoutData = createWorkoutData() {
workoutComplete = .completedWorkout(workoutData)
} else {
bridgeModule.resetCurrentWorkout()
}
}
bridgeModule.start(workout: workout)
}