android: use onSuccess parameter in setWantRunning (#516)

Previously we were never actually invoking this parameter
We previously weren't setting vpnActive after closing IPNService

Updates tailscale/corp#22284

Signed-off-by: kari-ts <kari@tailscale.com>
pull/518/head
kari-ts 1 year ago committed by GitHub
parent 22de0cdb7e
commit 2ec7304092
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -160,7 +160,7 @@ class App : UninitializedApp(), libtailscale.AppContext, ViewModelStoreOwner {
fun setWantRunning(wantRunning: Boolean, onSuccess: (() -> Unit)? = null) { fun setWantRunning(wantRunning: Boolean, onSuccess: (() -> Unit)? = null) {
val callback: (Result<Ipn.Prefs>) -> Unit = { result -> val callback: (Result<Ipn.Prefs>) -> Unit = { result ->
result.fold( result.fold(
onSuccess = {}, onSuccess = { onSuccess?.invoke() },
onFailure = { error -> onFailure = { error ->
Log.d("TAG", "Set want running: failed to update preferences: ${error.message}") Log.d("TAG", "Set want running: failed to update preferences: ${error.message}")
}) })

Loading…
Cancel
Save