Skip to content

Commit 91d0406

Browse files
committed
Don't restart the VPN if selected apps are viewed but not changed
1 parent 92f45b5 commit 91d0406

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,11 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
513513
launch { connectToVpnFromUrl(url) }
514514
} else if (requestCode == PICK_APPS_REQUEST) {
515515
app.trackEvent("Setup", "picked-apps")
516-
app.uninterceptedApps = data!!.getStringArrayExtra(UNSELECTED_APPS_EXTRA)!!.toSet()
517-
518-
if (isVpnActive()) startVpn()
516+
val unselectedApps = data!!.getStringArrayExtra(UNSELECTED_APPS_EXTRA)!!.toSet()
517+
if (unselectedApps != app.uninterceptedApps) {
518+
app.uninterceptedApps = unselectedApps
519+
if (isVpnActive()) startVpn()
520+
}
519521
}
520522
} else if (
521523
requestCode == START_VPN_REQUEST &&

0 commit comments

Comments
 (0)