This commit is contained in:
Trey t
2023-07-07 14:13:24 -05:00
parent f7ab828b28
commit 1f1e8cecdd
2 changed files with 13 additions and 0 deletions

View File

@@ -184,6 +184,18 @@ class BridgeModule: NSObject, ObservableObject {
duration > 0 {
print(duration)
self.startExerciseTimerWith(duration: duration)
} else {
var intWatchDispaly = -1
if let reps = self.currentExercise?.reps,
reps > 0 {
intWatchDispaly = reps
}
// if not a timer we need to set the watch display with number of reps
// if timer it will set when timer updates
let watchModel = WatchPackageModel(currentExerciseName: self.currentExercise?.exercise.name ?? "-", currentTimeLeft: intWatchDispaly, workoutStartDate: self.workoutStartDate ?? Date())
let data = try! JSONEncoder().encode(watchModel)
self.send(data)
}
}
}

View File

@@ -38,6 +38,7 @@ struct WorkoutDetailView: View {
CountdownView()
}
.padding()
.frame(maxWidth: .infinity)
.background(Color(uiColor: .systemBackground))
GeometryReader { metrics in