avoid opening the room list when going back from the settings page

This commit is contained in:
Adam Brown 2022-11-03 17:24:47 +00:00
parent ac6c4e8194
commit a709fe503a
1 changed files with 5 additions and 1 deletions

View File

@ -57,7 +57,11 @@ internal class HomeViewModel(
private suspend fun initialHomeContent(): SignedIn { private suspend fun initialHomeContent(): SignedIn {
val me = chatEngine.me(forceRefresh = false) val me = chatEngine.me(forceRefresh = false)
val initialInvites = chatEngine.invites().first().size val initialInvites = chatEngine.invites().first().size
return SignedIn(Page.Directory, me, invites = initialInvites) return when (val current = state) {
Loading -> SignedIn(Page.Directory, me, invites = initialInvites)
is SignedIn -> current.copy(me = me, invites = initialInvites)
SignedOut -> SignedIn(Page.Directory, me, invites = initialInvites)
}
} }
fun loggedIn() { fun loggedIn() {