Skip to content
Snippets Groups Projects
Unverified Commit cf141fb7 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Improve card progress display (EXPOSUREAPP-4049) (#1771)

parent 8bb11ba3
No related branches found
No related tags found
No related merge requests found
...@@ -51,16 +51,14 @@ class TracingRepository @Inject constructor( ...@@ -51,16 +51,14 @@ class TracingRepository @Inject constructor(
private val internalActiveTracingDaysInRetentionPeriod = MutableStateFlow(0L) private val internalActiveTracingDaysInRetentionPeriod = MutableStateFlow(0L)
val activeTracingDaysInRetentionPeriod: Flow<Long> = internalActiveTracingDaysInRetentionPeriod val activeTracingDaysInRetentionPeriod: Flow<Long> = internalActiveTracingDaysInRetentionPeriod
private val internalIsRefreshing =
taskController.tasks.map { it.isDownloadDiagnosisKeysTaskRunning() || it.isRiskLevelTaskRunning() }
val tracingProgress: Flow<TracingProgress> = combine( val tracingProgress: Flow<TracingProgress> = combine(
internalIsRefreshing, taskController.tasks.map { it.isDownloadDiagnosisKeysTaskRunning() },
enfClient.isPerformingExposureDetection() enfClient.isPerformingExposureDetection(),
) { isDownloading, isCalculating -> taskController.tasks.map { it.isRiskLevelTaskRunning() }
) { isDownloading, isExposureDetecting, isRiskLeveling ->
when { when {
isDownloading -> TracingProgress.Downloading isDownloading -> TracingProgress.Downloading
isCalculating -> TracingProgress.ENFIsCalculating isExposureDetecting || isRiskLeveling -> TracingProgress.ENFIsCalculating
else -> TracingProgress.Idle else -> TracingProgress.Idle
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment