create ER diagram, refactor to conform to diagram, simplify session management
This commit is contained in:
@@ -63,8 +63,7 @@ struct ActiveWorkoutSessionControls: View {
|
||||
}
|
||||
|
||||
#Preview("isWorkingOut = true") {
|
||||
@Previewable @State var activeWorkoutSession = WorkoutSession()
|
||||
activeWorkoutSession.workout = Workout.sampleData.first!
|
||||
@Previewable @State var activeWorkoutSession = WorkoutSession(start: Workout.sampleData.first!)
|
||||
|
||||
// For some reason the return keyword is required here to avoid the error "Type of expression is ambiguous without a type annotation"
|
||||
return ActiveWorkoutSessionControls(session: $activeWorkoutSession)
|
||||
@@ -72,12 +71,3 @@ struct ActiveWorkoutSessionControls: View {
|
||||
Defaults.shared.isWorkingOut = true
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("isWorkingOut = false") {
|
||||
@Previewable @State var activeWorkoutSession = WorkoutSession()
|
||||
|
||||
return ActiveWorkoutSessionControls(session: $activeWorkoutSession)
|
||||
.onAppear() {
|
||||
Defaults.shared.isWorkingOut = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user