Import/export fixes, icon, and graphing
This commit is contained in:
@@ -95,16 +95,16 @@ struct AddEditProblemView: View {
|
||||
loadExistingProblem()
|
||||
setupInitialGym()
|
||||
}
|
||||
.onChange(of: selectedGym) { _ in
|
||||
.onChange(of: selectedGym) {
|
||||
updateAvailableOptions()
|
||||
}
|
||||
.onChange(of: selectedClimbType) { _ in
|
||||
.onChange(of: selectedClimbType) {
|
||||
updateDifficultySystem()
|
||||
}
|
||||
.onChange(of: selectedDifficultySystem) { _ in
|
||||
.onChange(of: selectedDifficultySystem) {
|
||||
resetGradeIfNeeded()
|
||||
}
|
||||
.onChange(of: selectedPhotos) { _ in
|
||||
.onChange(of: selectedPhotos) {
|
||||
Task {
|
||||
await loadSelectedPhotos()
|
||||
}
|
||||
@@ -171,7 +171,7 @@ struct AddEditProblemView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private func ClimbTypeSection() -> some View {
|
||||
if let gym = selectedGym {
|
||||
if selectedGym != nil {
|
||||
Section("Climb Type") {
|
||||
ForEach(availableClimbTypes, id: \.self) { climbType in
|
||||
HStack {
|
||||
@@ -227,8 +227,13 @@ struct AddEditProblemView: View {
|
||||
.font(.headline)
|
||||
|
||||
if selectedDifficultySystem == .custom || availableGrades.isEmpty {
|
||||
TextField("Enter custom grade", text: $difficultyGrade)
|
||||
TextField("Enter custom grade (numbers only)", text: $difficultyGrade)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.keyboardType(.numberPad)
|
||||
.onChange(of: difficultyGrade) {
|
||||
// Filter out non-numeric characters
|
||||
difficultyGrade = difficultyGrade.filter { $0.isNumber }
|
||||
}
|
||||
} else {
|
||||
Menu {
|
||||
if !difficultyGrade.isEmpty {
|
||||
|
||||
Reference in New Issue
Block a user