From be625b92b2462f844e0d3146f26df69b558764f0 Mon Sep 17 00:00:00 2001 From: Pablo Pajuelo Cabezas Date: Fri, 10 Jan 2025 14:02:50 +0100 Subject: [PATCH] fix: [ANDROAPP-6753] Event program takes too long to load --- .../datasets/dataSetTable/DataSetTableRepositoryImpl.kt | 2 +- .../datasets/datasetDetail/DataSetDetailRepositoryImpl.java | 2 +- .../main/java/org/dhis2/usescases/events/EventInfoProvider.kt | 2 +- .../programEventDetail/ProgramEventDetailRepositoryImpl.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableRepositoryImpl.kt b/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableRepositoryImpl.kt index 64fd93cc27..0c4b2e0bca 100644 --- a/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableRepositoryImpl.kt +++ b/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableRepositoryImpl.kt @@ -320,7 +320,7 @@ class DataSetTableRepositoryImpl( .`in`(UidsHelper.getUidsList(categoryOptionCombos)) dataValueRepository.blockingGet().isNotEmpty() && dataValueRepository - .blockingGet().size != categoryOptionCombos.size + .blockingCount() != categoryOptionCombos.size }?.map { dataSetElement -> dataSetElement.dataElement().uid() } ?: emptyList() } else { diff --git a/app/src/main/java/org/dhis2/usescases/datasets/datasetDetail/DataSetDetailRepositoryImpl.java b/app/src/main/java/org/dhis2/usescases/datasets/datasetDetail/DataSetDetailRepositoryImpl.java index 82119871d1..97be6f1fad 100644 --- a/app/src/main/java/org/dhis2/usescases/datasets/datasetDetail/DataSetDetailRepositoryImpl.java +++ b/app/src/main/java/org/dhis2/usescases/datasets/datasetDetail/DataSetDetailRepositoryImpl.java @@ -59,7 +59,7 @@ public Flowable> dataSetGroups(List orgUnits, L d2.dataSetModule().dataSets().uid(dataSetUid).blockingGet(); int dataSetOrgUnitNumber = d2.organisationUnitModule().organisationUnits() .byDataSetUids(Collections.singletonList(dataSetUid)) - .blockingGet().size(); + .blockingCount(); DataSetInstanceCollectionRepository finalRepo = repo; return Flowable.fromIterable(finalRepo.blockingGet()) diff --git a/app/src/main/java/org/dhis2/usescases/events/EventInfoProvider.kt b/app/src/main/java/org/dhis2/usescases/events/EventInfoProvider.kt index 518741c5ec..8824555d90 100644 --- a/app/src/main/java/org/dhis2/usescases/events/EventInfoProvider.kt +++ b/app/src/main/java/org/dhis2/usescases/events/EventInfoProvider.kt @@ -435,6 +435,6 @@ class EventInfoProvider( fromCache(cachedDisplayOrgUnit, programUid) { d2.organisationUnitModule().organisationUnits() .byProgramUids(listOf(programUid)) - .blockingGet().size > 1 + .blockingCount() > 1 } == true } diff --git a/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailRepositoryImpl.kt b/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailRepositoryImpl.kt index 4300aecc9a..83824e9eaa 100644 --- a/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailRepositoryImpl.kt +++ b/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailRepositoryImpl.kt @@ -164,6 +164,6 @@ class ProgramEventDetailRepositoryImpl internal constructor( override fun displayOrganisationUnit(programUid: String): Boolean { return d2.organisationUnitModule().organisationUnits() .byProgramUids(listOf(programUid)) - .blockingGet().size > 1 + .blockingCount() > 1 } }