Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Fix navigation when not requesting DGC (EXPOSUREAPP-14240) #5725

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class SubmissionConsentFragment : Fragment(R.layout.fragment_submission_consent)
is SubmissionNavigationEvents.NavigateToDataPrivacy -> findNavController().navigate(
SubmissionConsentFragmentDirections.actionSubmissionConsentFragmentToInformationPrivacyFragment()
)

is SubmissionNavigationEvents.ResolvePlayServicesException ->
it.exception.status.startResolutionForResult(
requireActivity(),
Expand All @@ -79,19 +80,22 @@ class SubmissionConsentFragment : Fragment(R.layout.fragment_submission_consent)
),
navOptions
)

is SubmissionNavigationEvents.NavigateClose -> {
if (navArgs.comesFromDispatcherFragment) {
findNavController().navigate(
SubmissionConsentFragmentDirections.actionSubmissionConsentFragmentToHomeFragment()
)
} else popBackStack()
}

is SubmissionNavigationEvents.NavigateBackToTestRegistration -> findNavController().navigate(
SubmissionConsentFragmentDirections
.actionSubmissionConsentFragmentToTestRegistrationSelectionFragment(
navArgs.coronaTestQrCode
)
)

else -> Unit
}
}
Expand All @@ -113,17 +117,20 @@ class SubmissionConsentFragment : Fragment(R.layout.fragment_submission_consent)
State.Working -> {
// Handled above
}

is State.Error -> state.showExceptionDialog(this) { popBackStack() }
is State.TestRegistered -> when {
state.test.isPositive ->
NavGraphDirections.actionToSubmissionTestResultAvailableFragment(
testIdentifier = state.test.identifier
testIdentifier = state.test.identifier,
comesFromDispatcherFragment = navArgs.comesFromDispatcherFragment
)
.run { findNavController().navigate(this, navOptions) }

else ->
NavGraphDirections.actionSubmissionTestResultPendingFragment(
testIdentifier = state.test.identifier
testIdentifier = state.test.identifier,
comesFromDispatcherFragment = navArgs.comesFromDispatcherFragment
)
.run { findNavController().navigate(this, navOptions) }
}
Expand Down