diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/consent/CheckInsConsentViewModel.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/consent/CheckInsConsentViewModel.kt index 8994e8e0496..f7fbc8ea054 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/consent/CheckInsConsentViewModel.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/consent/CheckInsConsentViewModel.kt @@ -144,18 +144,16 @@ class CheckInsConsentViewModel @AssistedInject constructor( private fun initialSet(): Set = savedState.get(SET_KEY) ?: emptySet() - private fun resetPreviousSubmissionConsents() = launch { - try { - Timber.d("Trying to reset submission consents") - checkInRepository.apply { - val ids = completedCheckIns.first().filter { it.hasSubmissionConsent }.map { it.id } - updateSubmissionConsents(ids, consent = false) - } - - Timber.d("Resetting submission consents was successful") - } catch (error: Exception) { - Timber.e(error, "Failed to reset SubmissionConsents") + private suspend fun resetPreviousSubmissionConsents() = try { + Timber.d("Trying to reset submission consents") + checkInRepository.apply { + val ids = completedCheckIns.first().filter { it.hasSubmissionConsent }.map { it.id } + updateSubmissionConsents(ids, consent = false) } + + Timber.d("Resetting submission consents was successful") + } catch (error: Exception) { + Timber.e(error, "Failed to reset SubmissionConsents") } @AssistedFactory