android: use onSuccess parameter in setWantRunning

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/516/head
kari-ts 1 year ago committed by kari-ts
parent 22de0cdb7e
commit 5fc8a889c7

@ -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