Skip to content

Commit

Permalink
don't navigate to the same app status fragment, if it is already open
Browse files Browse the repository at this point in the history
  • Loading branch information
ktiniatros committed Nov 25, 2021
1 parent 33e83f2 commit 961b2cd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 961b2cd

Please sign in to comment.