|
|
|
@ -18,8 +18,8 @@ struct SubjectViewCell: View {
|
|
|
|
|
HStack {
|
|
|
|
|
VStack {
|
|
|
|
|
// FIXME (later, maybe) when getting updated from the UnitView, these two changes are persisted right away instead of waiting for user
|
|
|
|
|
// to confirm changes. Or is it rather that we were updating these fields, and then changing the grade, thus calling
|
|
|
|
|
// unitsManagerVM.updateUnit(unitVM) ? If so, how to even fix that?
|
|
|
|
|
// to confirm changes. They just don't get brought into the main UnitsManager, so the average is not recalculated when a unit's weight changes
|
|
|
|
|
// when 'cancel' is hit, it would be nice to reset these two values as well, like a user might expect
|
|
|
|
|
HStack {
|
|
|
|
|
TextField("", text: $subjectVM.model.name)
|
|
|
|
|
.disabled(!unitsManagerVM.isAllEditable)
|
|
|
|
@ -42,7 +42,8 @@ struct SubjectViewCell: View {
|
|
|
|
|
unitVM.updateSubject(subjectVM)
|
|
|
|
|
try await unitsManagerVM.updateUnit(unitVM)
|
|
|
|
|
} catch {
|
|
|
|
|
print("Failed to update grade: \(error)")
|
|
|
|
|
// DEV: this should be replaced with proper error handling before ever going to prod
|
|
|
|
|
print("ERROR: Failed to update grade: \(error)")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|