#99 fix update subject name after edit

This commit is contained in:
brreynie 2023-05-10 16:43:14 +02:00
parent de25ed85b5
commit a7752e5706

View file

@ -75,11 +75,13 @@ class SubjectEditFormViewModel @Inject constructor(
}
fun onEdit(openAndPopUp: (String, String) -> Unit) {
val newSubject = selectedSubject().copy(
name = name,
argb_color = color,
selectedSubject.set(
selectedSubject().copy(
name = name,
argb_color = color,
)
)
subjectDAO.updateSubject(newSubject)
subjectDAO.updateSubject(selectedSubject())
openAndPopUp(StudeezDestinations.TASKS_SCREEN, StudeezDestinations.EDIT_SUBJECT_FORM)
}
}