android/ui: show the switching-to user immediately on FUS switch (#280)

Updates tailscale/corp#18202

Reload the loggedInUser on all state transitions to ensure FUS switches are always properly represented

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
pull/284/head
Jonathan Nobels 2 months ago committed by GitHub
parent d188da3a24
commit 75ad5cfef6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -38,11 +38,8 @@ open class IpnViewModel : ViewModel() {
init {
viewModelScope.launch {
Notifier.state.collect {
// Refresh the user profiles if we're transitioning out of the
// NeedsLogin state.
if (it == Ipn.State.NeedsLogin) {
viewModelScope.launch { loadUserProfiles() }
}
// Reload the user profiles on all state transitions to ensure loggedInUser is correct
viewModelScope.launch { loadUserProfiles() }
}
}

Loading…
Cancel
Save