Skip to content

Commit

Permalink
Merge branch 'fix/permission-version-react' of https://github.com/Tea…
Browse files Browse the repository at this point in the history
…mDMU/DMU-Android into fix/permission-version-react
  • Loading branch information
m6z1 committed Apr 21, 2024
2 parents 6f49322 + 8cdcdc6 commit 5830f42
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ class CafeteriaViewModel(
fun updateMenuList(selectedDate: LocalDate) {
val cafeteriaList = _cafeteriaList.value ?: emptyList()
_selectedDate.value = selectedDate
val selectedMenu = cafeteriaList.find { it.date == selectedDate.toString() }?.menus
_menus.postValue(
cafeteriaList.find { it.date == selectedDate.toString() }?.menus
.takeIf { it.isNullOrEmpty() }
?.let { emptyMenu }
?: cafeteriaList.find { it.date == selectedDate.toString() }?.menus
if (selectedMenu.isNullOrEmpty()) {
emptyMenu
} else {
selectedMenu
}
)
}
}

0 comments on commit 5830f42

Please sign in to comment.