From a0d90ddbe67c87aaa47805644b39e50966ac78fb Mon Sep 17 00:00:00 2001
From: Norbel AMBANUMBEN <aanorbel@gmail.com>
Date: Fri, 11 Oct 2024 21:55:07 +0100
Subject: [PATCH] feat(invite-code): update state to switch provider when
 provider previously configured

---
 .../providersetup/activities/SetupActivity.java        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/SetupActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/SetupActivity.java
index 75d2f29ef..871239765 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/SetupActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/SetupActivity.java
@@ -99,6 +99,13 @@ public class SetupActivity extends AppCompatActivity implements SetupActivityCal
             addIndicatorView(indicatorViews);
         }
 
+        if (getIntent() != null) {
+            if (ProviderObservable.getInstance().getCurrentProvider().isConfigured()){
+                switchProvider = true;
+            }
+            manageIntent(getIntent());
+        }
+
         // indicator views for config setup
         boolean basicProviderSetup = !ProviderObservable.getInstance().getCurrentProvider().isConfigured() || switchProvider;
         if (basicProviderSetup) {
@@ -172,9 +179,6 @@ public class SetupActivity extends AppCompatActivity implements SetupActivityCal
             }
         }
         binding.viewPager.setCurrentItem(currentPosition, false);
-       if (getIntent() != null) {
-           manageIntent(getIntent());
-       }
     }
 
     /**
-- 
GitLab