mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 20:02:45 +01:00
Fix error view in attendance summary (#1492)
This commit is contained in:
parent
6d5acbad2c
commit
e665a8f18b
@ -82,7 +82,13 @@ class AttendanceSummaryPresenter @Inject constructor(
|
||||
flowWithResourceIn {
|
||||
val student = studentRepository.getCurrentStudent()
|
||||
val semester = semesterRepository.getCurrentSemester(student)
|
||||
attendanceSummaryRepository.getAttendanceSummary(student, semester, subjectId, forceRefresh)
|
||||
|
||||
attendanceSummaryRepository.getAttendanceSummary(
|
||||
student = student,
|
||||
semester = semester,
|
||||
subjectId = subjectId,
|
||||
forceRefresh = forceRefresh
|
||||
)
|
||||
}.onEach {
|
||||
when (it.status) {
|
||||
Status.LOADING -> {
|
||||
@ -92,6 +98,7 @@ class AttendanceSummaryPresenter @Inject constructor(
|
||||
showRefresh(true)
|
||||
showProgress(false)
|
||||
showContent(true)
|
||||
showErrorView(false)
|
||||
updateDataSet(sortItems(it.data))
|
||||
}
|
||||
}
|
||||
@ -99,6 +106,7 @@ class AttendanceSummaryPresenter @Inject constructor(
|
||||
Status.SUCCESS -> {
|
||||
Timber.i("Loading attendance summary result: Success")
|
||||
view?.apply {
|
||||
showErrorView(false)
|
||||
showEmpty(it.data!!.isEmpty())
|
||||
showContent(it.data.isNotEmpty())
|
||||
updateDataSet(sortItems(it.data))
|
||||
|
Loading…
x
Reference in New Issue
Block a user