Launch the watch from the exercise-list start path too
The "Start This Split" button on a split's exercise list minted and saved the workout but never called WorkoutLauncher, so the Apple Watch never came up when starting from there — only the home-screen split picker launched it. Inject AppServices into ExerciseListView and call launchWatchWorkout from start(), mirroring the picker path. Claude-Session: https://claude.ai/code/session_01PVNBVKp5bcq52X722uMjwT
This commit is contained in:
@@ -13,6 +13,7 @@ import SwiftData
|
||||
|
||||
struct ExerciseListView: View {
|
||||
@Environment(SyncEngine.self) private var sync
|
||||
@Environment(AppServices.self) private var services
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
// Resolve the split by id, not a captured entity: editing a seed's exercise from
|
||||
@@ -221,6 +222,9 @@ struct ExerciseListView: View {
|
||||
await sync.save(workout: doc)
|
||||
pendingWorkoutID = doc.id
|
||||
}
|
||||
// Bring the Apple Watch up into the session so the user can run it from the wrist,
|
||||
// tagged with the split's activity type — mirroring the split-picker start path.
|
||||
services.workoutLauncher.launchWatchWorkout(activityType: split.activityTypeEnum.hkActivityType)
|
||||
}
|
||||
|
||||
private func addExercises(names: [String]) {
|
||||
|
||||
Reference in New Issue
Block a user