WIP
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ struct WorkoutDetailView: View {
|
||||
CountdownView()
|
||||
}
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity)
|
||||
.background(Color(uiColor: .systemBackground))
|
||||
|
||||
GeometryReader { metrics in
|
||||
|
||||
Reference in New Issue
Block a user