WIP
This commit is contained in:
@@ -121,7 +121,8 @@ struct CompletedWorkoutView: View {
|
||||
|
||||
func heartRates() -> some View {
|
||||
VStack {
|
||||
if let heartRates = postData["heart_rates"] as? [Int] {
|
||||
if let heartRates = postData["heart_rates"] as? [Int],
|
||||
heartRates.count > 0 {
|
||||
let avg = heartRates.reduce(0, +)/heartRates.count
|
||||
HStack {
|
||||
Image(systemName: "heart")
|
||||
|
||||
@@ -113,9 +113,9 @@ struct ExtCountdownView: View {
|
||||
}
|
||||
HStack {
|
||||
if let duration = currenExercise.duration {
|
||||
ProgressView(value: Float(bridgeModule.timeLeft), total: Float(duration))
|
||||
ProgressView(value: Float(bridgeModule.currentExerciseTimeLeft), total: Float(duration))
|
||||
.scaleEffect(x: 1, y: 6, anchor: .center)
|
||||
Text("\(bridgeModule.timeLeft)")
|
||||
Text("\(bridgeModule.currentExerciseTimeLeft)")
|
||||
.font(Font.system(size: 75))
|
||||
.padding([.leading, .trailing])
|
||||
} else if let reps = currenExercise.reps {
|
||||
|
||||
@@ -35,8 +35,7 @@ struct WorkoutDetailView: View {
|
||||
CountdownView()
|
||||
ExerciseListView(workout: workout)
|
||||
ActionsView(completedWorkout: {
|
||||
bridgeModule.workoutEndDate = Date()
|
||||
bridgeModule.sendWorkoutCompleteToWatch()
|
||||
bridgeModule.completeWorkout()
|
||||
}, planWorkout: { workout in
|
||||
workoutToPlan = workout
|
||||
}, workout: workout, showAddToCalendar: showAddToCalendar)
|
||||
@@ -62,7 +61,7 @@ struct WorkoutDetailView: View {
|
||||
}
|
||||
}
|
||||
.onAppear{
|
||||
bridgeModule.completedWorkoutFromWatch = {
|
||||
bridgeModule.completedWorkout = {
|
||||
if let workoutData = createWorkoutData() {
|
||||
presentedSheet = .completedWorkout(workoutData)
|
||||
bridgeModule.resetCurrentWorkout()
|
||||
@@ -223,7 +222,7 @@ struct ExerciseListView: View {
|
||||
|
||||
Text(obj.exercise.name)
|
||||
.onTapGesture {
|
||||
bridgeModule.start(workout: workout, atExerciseIndex: i)
|
||||
bridgeModule.goToExerciseAt(index: i)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
@@ -257,8 +256,8 @@ struct CountdownView: View {
|
||||
VStack {
|
||||
if let duration = bridgeModule.currentExercise?.duration {
|
||||
HStack {
|
||||
ProgressView(value: Float(bridgeModule.timeLeft), total: Float(duration))
|
||||
Text("\(bridgeModule.timeLeft)")
|
||||
ProgressView(value: Float(bridgeModule.currentExerciseTimeLeft), total: Float(duration))
|
||||
Text("\(bridgeModule.currentExerciseTimeLeft)")
|
||||
}.padding(16)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user