summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-12-13 02:37:51 +0100
committercyBerta <cyberta@riseup.net>2022-12-15 23:57:15 +0100
commit628f2466d6c351357ee7f1fd6623f750d1d6f46a (patch)
tree2c586425e42a8ab80d12e03ea22c632d7a0150ba /app/src
parentcb0eae7999271ba3db98d160fb60f0fdf6991841 (diff)
don't create a new GatewaysSelectionFragment if it is already shown
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
index fe36e00a..5c4e891e 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
@@ -307,6 +307,10 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen
manualGatewaySelection.setOnClickListener(v -> {
FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager());
closeDrawer();
+ Fragment current = fragmentManager.findFragmentByTag(MainActivity.TAG);
+ if (current instanceof GatewaySelectionFragment) {
+ return;
+ }
Fragment fragment = new GatewaySelectionFragment();
fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG);
});