From ec761f63294d977b46455a09c68d65236903436f Mon Sep 17 00:00:00 2001 From: Mateusz Idziejczak Date: Tue, 8 Sep 2020 20:13:17 +0200 Subject: [PATCH] Fix bug in grade statistics (#951) --- .../ui/modules/grade/statistics/GradeStatisticsPresenter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt index 112f4c58..73cee9e9 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt @@ -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)