fix naming on variable
fix tapping on exercise not updating external correctly
This commit is contained in:
Trey t
2024-08-28 08:55:41 -05:00
parent bfb373c8af
commit 2d5d55c272
14 changed files with 51 additions and 55 deletions

View File

@@ -21,7 +21,7 @@ extension BridgeModule {
}
func nextExercise() {
if let nextSupersetExercise = currentExerciseInfo.goToNextExercise {
if let nextSupersetExercise = currentWorkoutInfo.goToNextExercise {
updateCurrent(exercise: nextSupersetExercise)
} else {
completeWorkout()
@@ -29,7 +29,7 @@ extension BridgeModule {
}
func previousExercise() {
if let nextSupersetExercise = currentExerciseInfo.previousExercise {
if let nextSupersetExercise = currentWorkoutInfo.previousExercise {
updateCurrent(exercise: nextSupersetExercise)
} else {
completeWorkout()
@@ -37,7 +37,7 @@ extension BridgeModule {
}
func restartExercise() {
if let currentExercise = currentExerciseInfo.currentExercise {
if let currentExercise = currentWorkoutInfo.currentExercise {
updateCurrent(exercise: currentExercise)
}
}
@@ -67,17 +67,17 @@ extension BridgeModule {
}
func start(workout: Workout) {
currentExerciseInfo.complete = {
currentWorkoutInfo.complete = {
self.completeWorkout()
}
currentExerciseInfo.start(workout: workout)
currentWorkoutInfo.start(workout: workout)
currentWorkoutRunTimeInSeconds = 0
currentWorkoutRunTimer?.invalidate()
currentWorkoutRunTimer = nil
isPaused = false
if let superetExercise = currentExerciseInfo.currentExercise {
if let superetExercise = currentWorkoutInfo.currentExercise {
updateCurrent(exercise: superetExercise)
startWorkoutTimer()
workoutStartDate = Date()
@@ -91,15 +91,8 @@ extension BridgeModule {
}
}
func goToExerciseAt(section: Int, row: Int) {
if let superetExercise = currentExerciseInfo.goToWorkoutAt(supersetIndex: section,
exerciseIndex: row) {
updateCurrent(exercise: superetExercise)
}
}
var nextExerciseObject: SupersetExercise? {
currentExerciseInfo.goToNextExercise
currentWorkoutInfo.goToNextExercise
}
func resetCurrentWorkout() {
@@ -115,7 +108,7 @@ extension BridgeModule {
self.currentExerciseTimer = nil
self.currentWorkoutRunTimeInSeconds = -1
self.currentExerciseInfo.reset()
self.currentWorkoutInfo.reset()
self.isInWorkout = false
self.workoutStartDate = nil