adds content type on CardFeedView

pull/446/merge
Vitor Pamplona 2024-04-18 17:17:17 -04:00
rodzic 5ea793eb51
commit 0c9e76eeaf
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -158,7 +158,11 @@ private fun FeedLoaded(
ShowDonationCard(accountViewModel, nav)
}
itemsIndexed(state.feed.value, key = { _, item -> item.id() }) { _, item ->
itemsIndexed(
items = state.feed.value,
key = { _, item -> item.id() },
contentType = { _, item -> item.javaClass.simpleName },
) { _, item ->
val defaultModifier = remember { Modifier.fillMaxWidth().animateItemPlacement() }
Row(defaultModifier) {

Wyświetl plik

@ -301,7 +301,9 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel(), I
if (notes.isEmpty()) {
_feedContent.update { CardFeedState.Empty }
} else if (currentState is CardFeedState.Loaded) {
currentState.showHidden.value = localFilter.showHiddenKey()
if (currentState.showHidden.value != localFilter.showHiddenKey()) {
currentState.showHidden.value = localFilter.showHiddenKey()
}
currentState.feed.value = notes
} else {
_feedContent.update {