mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 12:01:52 +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(
|
||||||
items = state.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 = {
|
contentType = {
|
||||||
when (it) {
|
when (it) {
|
||||||
is ExtensionUiModel.Item -> "item"
|
is ExtensionUiModel.Item -> "item"
|
||||||
else -> "header"
|
else -> "header"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
key = {
|
||||||
|
when (it) {
|
||||||
|
is ExtensionUiModel.Header.Resource -> it.textRes
|
||||||
|
is ExtensionUiModel.Header.Text -> it.text
|
||||||
|
is ExtensionUiModel.Item -> "extension-${it.key()}"
|
||||||
|
}
|
||||||
|
},
|
||||||
) { item ->
|
) { item ->
|
||||||
when (item) {
|
when (item) {
|
||||||
is ExtensionUiModel.Header.Resource -> {
|
is ExtensionUiModel.Header.Resource -> {
|
||||||
|
@ -112,7 +112,7 @@ private fun MigrateSourceList(
|
|||||||
|
|
||||||
items(
|
items(
|
||||||
items = list,
|
items = list,
|
||||||
key = { (source, _) -> source.id },
|
key = { (source, _) -> "migrate-${source.id}" },
|
||||||
) { (source, count) ->
|
) { (source, count) ->
|
||||||
MigrateSourceItem(
|
MigrateSourceItem(
|
||||||
modifier = Modifier.animateItemPlacement(),
|
modifier = Modifier.animateItemPlacement(),
|
||||||
|
@ -86,7 +86,7 @@ private fun SourcesFilterContent(
|
|||||||
key = {
|
key = {
|
||||||
when (it) {
|
when (it) {
|
||||||
is FilterUiModel.Header -> it.hashCode()
|
is FilterUiModel.Header -> it.hashCode()
|
||||||
is FilterUiModel.Item -> it.source.key()
|
is FilterUiModel.Item -> "source-filter-${it.source.key()}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) { model ->
|
) { model ->
|
||||||
|
@ -95,7 +95,7 @@ private fun SourceList(
|
|||||||
key = {
|
key = {
|
||||||
when (it) {
|
when (it) {
|
||||||
is SourceUiModel.Header -> it.hashCode()
|
is SourceUiModel.Header -> it.hashCode()
|
||||||
is SourceUiModel.Item -> it.source.key()
|
is SourceUiModel.Item -> "source-${it.source.key()}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) { model ->
|
) { model ->
|
||||||
|
@ -28,7 +28,7 @@ fun CategoryContent(
|
|||||||
) {
|
) {
|
||||||
itemsIndexed(
|
itemsIndexed(
|
||||||
items = categories,
|
items = categories,
|
||||||
key = { _, category -> category.id },
|
key = { _, category -> "category-${category.id}" },
|
||||||
) { index, category ->
|
) { index, category ->
|
||||||
CategoryListItem(
|
CategoryListItem(
|
||||||
modifier = Modifier.animateItemPlacement(),
|
modifier = Modifier.animateItemPlacement(),
|
||||||
|
@ -645,7 +645,7 @@ private fun LazyListScope.sharedChapterItems(
|
|||||||
) {
|
) {
|
||||||
items(
|
items(
|
||||||
items = chapters,
|
items = chapters,
|
||||||
key = { it.chapter.id },
|
key = { "chapter-${it.chapter.id}" },
|
||||||
contentType = { MangaScreenItem.CHAPTER },
|
contentType = { MangaScreenItem.CHAPTER },
|
||||||
) { chapterItem ->
|
) { chapterItem ->
|
||||||
val haptic = LocalHapticFeedback.current
|
val haptic = LocalHapticFeedback.current
|
||||||
|
@ -93,7 +93,7 @@ fun LazyListScope.updatesUiItems(
|
|||||||
key = {
|
key = {
|
||||||
when (it) {
|
when (it) {
|
||||||
is UpdatesUiModel.Header -> it.hashCode()
|
is UpdatesUiModel.Header -> it.hashCode()
|
||||||
is UpdatesUiModel.Item -> it.item.update.chapterId
|
is UpdatesUiModel.Item -> "updates-${it.item.update.chapterId}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) { item ->
|
) { item ->
|
||||||
|
Loading…
Reference in New Issue
Block a user