This commit is contained in:
Trey t
2023-07-05 17:50:33 -05:00
parent 52ab089c12
commit 4bcfd6a7fa
2 changed files with 69 additions and 24 deletions

View File

@@ -74,7 +74,6 @@ struct WorkoutDetailView: View {
dismiss()
})
}
.interactiveDismissDisabled()
}
}
.onChange(of: bridgeModule.currentExercise, perform: { newValue in
@@ -96,6 +95,24 @@ struct WorkoutDetailView: View {
}
})
.onAppear{
var _url: URL?
if let currentExercise = bridgeModule.currentExercise {
if showNSFWVideos {
let viddd = currentExercise.exercise.nsfwVideoURL
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
_url = url
}
} else {
let viddd = currentExercise.exercise.videoURL
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
_url = url
}
}
if let __url = _url {
avPlayer = AVPlayer(url: __url)
avPlayer.play()
}
}
bridgeModule.completedWorkout = {
if let workoutData = createWorkoutData() {
presentedSheet = .completedWorkout(workoutData)