WIP
This commit is contained in:
@@ -18,6 +18,7 @@ class BridgeModule: ObservableObject {
|
||||
var currentWorkout: Workout?
|
||||
var currentExerciseIdx: Int = -1
|
||||
|
||||
var workoutStartDate: Date?
|
||||
@Published var currentWorkoutRunTimeInSeconds: Int = -1
|
||||
private var currentWorkoutRunTimer: Timer?
|
||||
|
||||
@@ -33,10 +34,11 @@ class BridgeModule: ObservableObject {
|
||||
let exercise = workout.exercises[currentExerciseIdx]
|
||||
updateCurrent(exercise: exercise)
|
||||
startWorkoutTimer()
|
||||
workoutStartDate = Date()
|
||||
isInWorkout = true
|
||||
}
|
||||
|
||||
func completeWorkout() {
|
||||
func resetCurrentWorkout() {
|
||||
currentWorkoutRunTimeInSeconds = 0
|
||||
currentWorkoutRunTimer?.invalidate()
|
||||
currentWorkoutRunTimer = nil
|
||||
@@ -51,6 +53,7 @@ class BridgeModule: ObservableObject {
|
||||
currentWorkout = nil
|
||||
|
||||
isInWorkout = false
|
||||
workoutStartDate = nil
|
||||
}
|
||||
|
||||
private func startWorkoutTimer() {
|
||||
|
||||
Reference in New Issue
Block a user