fix: data cleared coming back to community or user detail (#158)

This commit is contained in:
Diego Beraldin 2023-11-24 21:44:29 +01:00 committed by GitHub
parent c787ab3be2
commit 3ffa5f15b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ class CommunityDetailViewModel(
val auth = identityRepository.authToken.value.orEmpty()
mvi.updateState {
it.copy(
community = community,
community = it.community.takeIf { c -> c.id != 0 } ?: community,
isLogged = auth.isNotEmpty(),
)
}

View File

@ -58,7 +58,7 @@ class UserDetailViewModel(
}
mvi.updateState {
it.copy(
user = user,
user = it.user.takeIf { u -> u.id != 0 } ?: user,
)
}
mvi.scope?.launch {