fix(community): improvements to community list and detail

This commit is contained in:
Diego Beraldin 2023-08-15 18:03:50 +02:00
parent 9787bc533f
commit 2b9dfa799b
2 changed files with 38 additions and 32 deletions

View File

@ -299,6 +299,7 @@ class CommunityDetailScreen(
}, },
style = MaterialTheme.typography.headlineSmall, style = MaterialTheme.typography.headlineSmall,
) )
if (!isOnOtherInstance) {
Button( Button(
modifier = Modifier modifier = Modifier
.align(Alignment.CenterHorizontally) .align(Alignment.CenterHorizontally)
@ -336,6 +337,7 @@ class CommunityDetailScreen(
} }
} }
} }
}
items(uiState.posts, key = { it.id.toString() + it.myVote }) { post -> items(uiState.posts, key = { it.id.toString() + it.myVote }) { post ->
val dismissState = rememberDismissState( val dismissState = rememberDismissState(
confirmStateChange = { confirmStateChange = {

View File

@ -85,7 +85,11 @@ class CommunityListViewModel(
val items = communityRepository.getSubscribed( val items = communityRepository.getSubscribed(
auth = auth, auth = auth,
).filter { ).filter {
if (searchText.isNotBlank()) {
it.name.contains(searchText) it.name.contains(searchText)
} else {
true
}
} }
currentPage++ currentPage++
mvi.updateState { mvi.updateState {