From 7b60db9060ef55cfa328c49e59691238e2ddc66b Mon Sep 17 00:00:00 2001 From: rustamsafarovrs Date: Tue, 25 Jun 2024 15:22:56 +0500 Subject: [PATCH] [fix] remove delay in API call --- .../rsdevteam/inmuslim/data/repositories/RegionRepository.kt | 3 --- .../rsdevteam/inmuslim/data/repositories/TimingRepository.kt | 3 --- 2 files changed, 6 deletions(-) diff --git a/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/RegionRepository.kt b/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/RegionRepository.kt index 095654e..5c2ae3b 100644 --- a/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/RegionRepository.kt +++ b/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/RegionRepository.kt @@ -1,10 +1,8 @@ package tj.rsdevteam.inmuslim.data.repositories -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import tj.rsdevteam.inmuslim.data.api.Api -import tj.rsdevteam.inmuslim.data.constants.Constants import tj.rsdevteam.inmuslim.data.models.Region import tj.rsdevteam.inmuslim.data.models.Resource import tj.rsdevteam.inmuslim.data.preferences.Preferences @@ -32,7 +30,6 @@ class RegionRepository fun getRegions(): Flow>> = flow { emit(Resource.InProgress()) val result = api.getRegions() - delay(Constants.MIDDLE_DELAY) if (result.isSuccess && result.getOrNull()?.result == 0) { emit(Resource.Success(result.getOrThrow().regions.map { it.toRegion() })) } else { diff --git a/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/TimingRepository.kt b/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/TimingRepository.kt index 8e491bb..2e94e44 100644 --- a/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/TimingRepository.kt +++ b/app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/TimingRepository.kt @@ -1,10 +1,8 @@ package tj.rsdevteam.inmuslim.data.repositories -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import tj.rsdevteam.inmuslim.data.api.Api -import tj.rsdevteam.inmuslim.data.constants.Constants import tj.rsdevteam.inmuslim.data.models.Resource import tj.rsdevteam.inmuslim.data.models.Timing import tj.rsdevteam.inmuslim.data.models.api.GetTimingBodyDTO @@ -29,7 +27,6 @@ class TimingRepository fun getTiming(): Flow> = flow { emit(Resource.InProgress()) val result = api.getTiming(GetTimingBodyDTO(regionId = preferences.getRegionId())) - delay(Constants.MIDDLE_DELAY) if (result.isSuccess && result.getOrNull()?.result == 0) { emit(Resource.Success(result.getOrThrow().timing.toTiming())) } else {