Use more unique item keys
Should make stacktraces more distinguishable. (cherry picked from commit e90b39b29dc114af84aed284aa8201d97d7ba775) # Conflicts: # app/src/main/java/eu/kanade/presentation/browse/SourcesFilterScreen.kt
This commit is contained in:
parent
20a4a3af98
commit
b92f913f8e
@ -112,19 +112,19 @@ private fun ExtensionContent(
|
||||
) {
|
||||
items(
|
||||
items = state.items,
|
||||
key = {
|
||||
when (it) {
|
||||
is ExtensionUiModel.Header.Resource -> it.textRes
|
||||
is ExtensionUiModel.Header.Text -> it.text
|
||||
is ExtensionUiModel.Item -> it.key()
|
||||
}
|
||||
},
|
||||
contentType = {
|
||||
when (it) {
|
||||
is ExtensionUiModel.Item -> "item"
|
||||
else -> "header"
|
||||
}
|
||||
},
|
||||
key = {
|
||||
when (it) {
|
||||
is ExtensionUiModel.Header.Resource -> it.textRes
|
||||
is ExtensionUiModel.Header.Text -> it.text
|
||||
is ExtensionUiModel.Item -> "extension-${it.key()}"
|
||||
}
|
||||
},
|
||||
) { item ->
|
||||
when (item) {
|
||||
is ExtensionUiModel.Header.Resource -> {
|
||||
|
@ -123,7 +123,7 @@ private fun MigrateSourceList(
|
||||
|
||||
items(
|
||||
items = list,
|
||||
key = { (source, _) -> source.id },
|
||||
key = { (source, _) -> "migrate-${source.id}" },
|
||||
) { (source, count) ->
|
||||
MigrateSourceItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
|
@ -101,7 +101,7 @@ private fun SourcesFilterContent(
|
||||
key = {
|
||||
when (it) {
|
||||
is FilterUiModel.Header, is FilterUiModel.ToggleHeader -> it.hashCode()
|
||||
is FilterUiModel.Item -> it.source.key()
|
||||
is FilterUiModel.Item -> "source-filter-${it.source.key()}"
|
||||
}
|
||||
},
|
||||
) { model ->
|
||||
|
@ -106,7 +106,7 @@ private fun SourceList(
|
||||
key = {
|
||||
when (it) {
|
||||
is SourceUiModel.Header -> it.hashCode()
|
||||
is SourceUiModel.Item -> it.source.key()
|
||||
is SourceUiModel.Item -> "source-${it.source.key()}"
|
||||
}
|
||||
},
|
||||
) { model ->
|
||||
|
@ -28,7 +28,7 @@ fun CategoryContent(
|
||||
) {
|
||||
itemsIndexed(
|
||||
items = categories,
|
||||
key = { _, category -> category.id },
|
||||
key = { _, category -> "category-${category.id}" },
|
||||
) { index, category ->
|
||||
CategoryListItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
|
@ -819,7 +819,7 @@ private fun LazyListScope.sharedChapterItems(
|
||||
) {
|
||||
items(
|
||||
items = chapters,
|
||||
key = { it.chapter.id },
|
||||
key = { "chapter-${it.chapter.id}" },
|
||||
contentType = { MangaScreenItem.CHAPTER },
|
||||
) { chapterItem ->
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
@ -93,7 +93,7 @@ fun LazyListScope.updatesUiItems(
|
||||
key = {
|
||||
when (it) {
|
||||
is UpdatesUiModel.Header -> it.hashCode()
|
||||
is UpdatesUiModel.Item -> it.item.update.chapterId
|
||||
is UpdatesUiModel.Item -> "updates-${it.item.update.chapterId}"
|
||||
}
|
||||
},
|
||||
) { item ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user