Skip to content

Commit

Permalink
fix : 식단이 없을 경우 빈 리스트로 오는 것을 반영하여 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwoo-jo committed Apr 9, 2024
1 parent f62e3ac commit 0c87cf3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class CafeteriaViewModel(
val cafeteriaList = _cafeteriaList.value ?: emptyList()
_selectedDate.value = selectedDate
_menus.postValue(
cafeteriaList.find { it.date == selectedDate.toString() }?.menus ?: emptyMenu
cafeteriaList.find { it.date == selectedDate.toString() }?.menus
.takeIf { it.isNullOrEmpty() }
?.let { emptyMenu }
?: cafeteriaList.find { it.date == selectedDate.toString() }?.menus
)
}
}

0 comments on commit 0c87cf3

Please sign in to comment.