fix video being out of sync
This commit is contained in:
@@ -9,7 +9,7 @@ import Foundation
|
||||
|
||||
class CurrentWorkoutInfo {
|
||||
var supersetIndex: Int = 0
|
||||
var exerciseIndex: Int = 0
|
||||
var exerciseIndex: Int = -1
|
||||
var workout: Workout?
|
||||
var complete: (() -> Void)?
|
||||
|
||||
@@ -38,34 +38,18 @@ class CurrentWorkoutInfo {
|
||||
return obj
|
||||
}
|
||||
|
||||
// this is setting nothing so we can half ass it
|
||||
var nextExerciseInfo: SupersetExercise? {
|
||||
guard let workout = workout else { return nil }
|
||||
guard let supersets = workout.supersets else { return nil }
|
||||
|
||||
var _exerciseIndex = exerciseIndex + 1
|
||||
var _supersetIndex = supersetIndex
|
||||
let currentSuperSet = supersets[_supersetIndex]
|
||||
|
||||
if _exerciseIndex >= currentSuperSet.exercises.count {
|
||||
var _currentRound = currentRound + 1
|
||||
|
||||
if currentRound > currentSuperSet.rounds {
|
||||
_supersetIndex = _supersetIndex + 1
|
||||
_currentRound = 1
|
||||
|
||||
if supersetIndex >= supersets.count {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
_exerciseIndex = 0
|
||||
let _exerciseIndex = allSupersetExecerciseIndex + 1
|
||||
if _exerciseIndex >= workout.allSupersetExecercise?.count ?? -1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
let superset = supersets[_supersetIndex]
|
||||
let exercise = superset.exercises[_exerciseIndex]
|
||||
return exercise
|
||||
return workout.allSupersetExecercise?[_exerciseIndex]
|
||||
}
|
||||
|
||||
// this needs to set stuff for iphone
|
||||
var nextExercise: SupersetExercise? {
|
||||
guard let workout = workout else { return nil }
|
||||
guard let supersets = workout.supersets else { return nil }
|
||||
|
||||
Reference in New Issue
Block a user