1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2025-01-31 22:42:45 +01:00

Fix error view in attendance summary (#1492)

This commit is contained in:
Rafał Borcz 2021-09-10 00:48:29 +02:00 committed by GitHub
parent 6d5acbad2c
commit e665a8f18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,13 @@ class AttendanceSummaryPresenter @Inject constructor(
flowWithResourceIn { flowWithResourceIn {
val student = studentRepository.getCurrentStudent() val student = studentRepository.getCurrentStudent()
val semester = semesterRepository.getCurrentSemester(student) val semester = semesterRepository.getCurrentSemester(student)
attendanceSummaryRepository.getAttendanceSummary(student, semester, subjectId, forceRefresh)
attendanceSummaryRepository.getAttendanceSummary(
student = student,
semester = semester,
subjectId = subjectId,
forceRefresh = forceRefresh
)
}.onEach { }.onEach {
when (it.status) { when (it.status) {
Status.LOADING -> { Status.LOADING -> {
@ -92,6 +98,7 @@ class AttendanceSummaryPresenter @Inject constructor(
showRefresh(true) showRefresh(true)
showProgress(false) showProgress(false)
showContent(true) showContent(true)
showErrorView(false)
updateDataSet(sortItems(it.data)) updateDataSet(sortItems(it.data))
} }
} }
@ -99,6 +106,7 @@ class AttendanceSummaryPresenter @Inject constructor(
Status.SUCCESS -> { Status.SUCCESS -> {
Timber.i("Loading attendance summary result: Success") Timber.i("Loading attendance summary result: Success")
view?.apply { view?.apply {
showErrorView(false)
showEmpty(it.data!!.isEmpty()) showEmpty(it.data!!.isEmpty())
showContent(it.data.isNotEmpty()) showContent(it.data.isNotEmpty())
updateDataSet(sortItems(it.data)) updateDataSet(sortItems(it.data))