mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 18:38:23 +01:00
Use more unique item keys
Should make stacktraces more distinguishable.
This commit is contained in:
parent
f4c684b4b8
commit
e90b39b29d
@ -109,19 +109,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 -> {
|
||||
|
@ -112,7 +112,7 @@ private fun MigrateSourceList(
|
||||
|
||||
items(
|
||||
items = list,
|
||||
key = { (source, _) -> source.id },
|
||||
key = { (source, _) -> "migrate-${source.id}" },
|
||||
) { (source, count) ->
|
||||
MigrateSourceItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
|
@ -86,7 +86,7 @@ private fun SourcesFilterContent(
|
||||
key = {
|
||||
when (it) {
|
||||
is FilterUiModel.Header -> it.hashCode()
|
||||
is FilterUiModel.Item -> it.source.key()
|
||||
is FilterUiModel.Item -> "source-filter-${it.source.key()}"
|
||||
}
|
||||
},
|
||||
) { model ->
|
||||
|
@ -95,7 +95,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(),
|
||||
|
@ -645,7 +645,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…
Reference in New Issue
Block a user