From 961b2cd55485741e064c1248e5982c8f6979ebb3 Mon Sep 17 00:00:00 2001 From: Giorgos Papadopoulos Date: Thu, 25 Nov 2021 12:12:06 +0100 Subject: [PATCH] don't navigate to the same app status fragment, if it is already open --- .../nl/rijksoverheid/ctr/verifier/VerifierMainActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/verifier/src/main/java/nl/rijksoverheid/ctr/verifier/VerifierMainActivity.kt b/verifier/src/main/java/nl/rijksoverheid/ctr/verifier/VerifierMainActivity.kt index 40406d5f7..aa1581a04 100644 --- a/verifier/src/main/java/nl/rijksoverheid/ctr/verifier/VerifierMainActivity.kt +++ b/verifier/src/main/java/nl/rijksoverheid/ctr/verifier/VerifierMainActivity.kt @@ -123,7 +123,12 @@ class VerifierMainActivity : AppCompatActivity() { navController: NavController ) { val bundle = bundleOf(AppStatusFragment.EXTRA_APP_STATUS to appStatus) - navController.navigate(R.id.action_app_status, bundle) + // don't navigate to the same app status fragment, if it is already open + // otherwise, it can open again on top of the previous one looking like a glitch + val currentAppStatus = navController.currentBackStackEntry?.arguments?.get(AppStatusFragment.EXTRA_APP_STATUS) + if (appStatus != currentAppStatus) { + navController.navigate(R.id.action_app_status, bundle) + } } private fun showRecommendedUpdateDialog() {