add details to phone workout view

This commit is contained in:
Trey t
2024-06-16 18:24:00 -05:00
parent 1fbb0c90f4
commit 0ac3835a9f
6 changed files with 56 additions and 14 deletions

View File

@@ -51,7 +51,8 @@ class BridgeModule: NSObject, ObservableObject {
// tells the watch app to stop the workout
public private(set) var workoutEndDate: Date?
@Published public private(set) var healthKitUUID: UUID?
@Published var isPaused = false
var audioPlayer: AVAudioPlayer?
var avPlayer: AVPlayer?
@@ -64,6 +65,7 @@ class BridgeModule: NSObject, ObservableObject {
currentWorkoutRunTimeInSeconds = 0
currentWorkoutRunTimer?.invalidate()
currentWorkoutRunTimer = nil
isPaused = false
if let superetExercise = currentExerciseInfo.currentExercise {
updateCurrent(exercise: superetExercise)
@@ -161,7 +163,9 @@ class BridgeModule: NSObject, ObservableObject {
if let _ = currentExerciseTimer {
currentExerciseTimer?.invalidate()
currentExerciseTimer = nil
isPaused = true
} else {
isPaused = false
startExerciseTimerWith(duration: currentExerciseTimeLeft)
}
}