Fix bug in grade statistics (#951)

This commit is contained in:
Mateusz Idziejczak 2020-09-08 20:13:17 +02:00 committed by GitHub
parent 6363c90e37
commit ec761f6329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,8 +164,8 @@ class GradeStatisticsPresenter @Inject constructor(
Status.SUCCESS -> {
Timber.i("Loading grade stats result: Success")
view?.run {
showEmpty(it.data!!.isEmpty())
showContent(it.data.isNotEmpty())
showEmpty(it.data!!.isEmpty() || it.data.first().partial.isEmpty())
showContent(it.data.isNotEmpty() && it.data.first().partial.isNotEmpty())
showErrorView(false)
updateData(it.data, preferencesRepository.gradeColorTheme, preferencesRepository.showAllSubjectsOnStatisticsList)
showSubjects(!preferencesRepository.showAllSubjectsOnStatisticsList)