Skip to content

Commit 3ed1f5d

Browse files
committed
Allow connection setup from error states
This is only really relevant to intents, because we want to allow ACTION_VIEW if it arrives after a connection failed somehow.
1 parent d6e3671 commit 3ed1f5d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/tech/httptoolkit/android/MainActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
392392

393393
private suspend fun connectToVpnFromUrl(uri: Uri) {
394394
Log.i(TAG, "Connecting to VPN from URL: $uri")
395-
if (mainState != MainState.DISCONNECTED) return
395+
if (
396+
mainState != MainState.DISCONNECTED &&
397+
mainState != MainState.FAILED
398+
) return
396399

397400
withContext(Dispatchers.Main) {
398401
mainState = MainState.CONNECTING

0 commit comments

Comments
 (0)