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

Fix clicked corona-test links, with DCC support, not navigating to DCC consent...

Fix clicked corona-test links, with DCC support, not navigating to DCC consent screen, so it behaves the same as it when it is scanned via camera. (#3457)

Co-authored-by: default avatarMohamed Metwalli <mohamed.metwalli@sap.com>
parent 2343c970
No related branches found
No related tags found
No related merge requests found
......@@ -55,15 +55,18 @@ class SubmissionConsentFragment : Fragment(R.layout.fragment_submission_consent)
requireActivity(),
REQUEST_USER_RESOLUTION
)
is SubmissionNavigationEvents.NavigateToDeletionWarningFragmentFromQrCode -> {
doNavigate(
NavGraphDirections
.actionToSubmissionDeletionWarningFragment(
testRegistrationRequest = it.coronaTestQRCode,
isConsentGiven = it.consentGiven,
)
is SubmissionNavigationEvents.NavigateToDeletionWarningFragmentFromQrCode -> doNavigate(
NavGraphDirections.actionToSubmissionDeletionWarningFragment(
testRegistrationRequest = it.coronaTestQRCode,
isConsentGiven = it.consentGiven,
)
}
)
is SubmissionNavigationEvents.NavigateToRequestDccFragment -> doNavigate(
NavGraphDirections.actionRequestCovidCertificateFragment(
testRegistrationRequest = it.coronaTestQRCode,
coronaTestConsent = it.consentGiven
)
)
}
}
viewModel.countries.observe2(this) {
......
......@@ -83,17 +83,26 @@ class SubmissionConsentViewModel @AssistedInject constructor(
val coronaTest = submissionRepository.testForType(coronaTestQRCode.type).first()
if (coronaTest != null) {
SubmissionNavigationEvents.NavigateToDeletionWarningFragmentFromQrCode(
coronaTestQRCode,
consentGiven = true
).run { routeToScreen.postValue(this) }
} else {
registrationStateProcessor.startRegistration(
request = coronaTestQRCode,
isSubmissionConsentGiven = true,
allowReplacement = false
)
when {
coronaTest != null -> {
SubmissionNavigationEvents.NavigateToDeletionWarningFragmentFromQrCode(
coronaTestQRCode,
consentGiven = true
).run { routeToScreen.postValue(this) }
}
coronaTestQRCode.isDccSupportedByPoc && !coronaTestQRCode.isDccConsentGiven -> {
SubmissionNavigationEvents.NavigateToRequestDccFragment(
coronaTestQRCode = coronaTestQRCode,
consentGiven = true,
).run { routeToScreen.postValue(this) }
}
else -> {
registrationStateProcessor.startRegistration(
request = coronaTestQRCode,
isSubmissionConsentGiven = true,
allowReplacement = false
)
}
}
}
......
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