-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android: use EditPrefs instead of passing UpdatePrefs to start #370
Conversation
"Updats", whoops! 😝 |
fun login(options: Ipn.Options = Ipn.Options(), completionHandler: (Result<Unit>) -> Unit = {}) { | ||
|
||
fun login( | ||
options: Ipn.Options = Ipn.Options(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should just take the authKey string only? You don't have separate frontend-vs-backend log IDs on Android now, do you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
start.onFailure { completionHandler(Result.failure(it)) }.onSuccess { loginAction() } | ||
val startAction = { | ||
Client(viewModelScope).start(options) { start -> | ||
start.onFailure { completionHandler(Result.failure(it)) }.onSuccess { loginAction() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is the style, that's fine, but I personally think it's sad that onFailure and onSuccess's bodies don't line up in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the auto-formatter.
This allows us to precisely set the options we need during login and avoid wiping away defaults like AllowSingleHosts. Updates tailscale/tailscale#11731 Signed-off-by: Percy Wegmann <percy@tailscale.com>
Thanks for the review @agottardo, @bradfitz and @MulverineX |
Web version of tailscale/tailscale-android#370 This allows us to update the prefs rather than creating new prefs Updates #11731 Signed-off-by: kari-ts <kari@tailscale.com>
Web version of tailscale/tailscale-android#370 This allows us to update the prefs rather than creating new prefs Updates #11731 Signed-off-by: kari-ts <kari@tailscale.com>
This allows us to precisely set the options we need during login and avoid wiping away defaults like AllowSingleHost.
Updats tailscale/tailscale#11731