safe-guard some edge-cases where chapters are duplicated some how on a merged entry (#311)
This commit is contained in:
parent
37a817e8f8
commit
9a12a904ba
2 changed files with 7 additions and 1 deletions
|
|
@ -1204,7 +1204,9 @@ private fun LazyListScope.sharedChapterItems(
|
|||
items = chapters,
|
||||
key = { item ->
|
||||
when (item) {
|
||||
is ChapterList.MissingCount -> "missing-count-${item.id}"
|
||||
// KMK: using hashcode to prevent edge-cases where the missing count might duplicate,
|
||||
// especially on merged manga
|
||||
is ChapterList.MissingCount -> "missing-count-${item.hashCode()}"
|
||||
is ChapterList.Item -> "chapter-${item.id}"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1832,6 +1832,10 @@ class MangaScreenModel(
|
|||
|
||||
val processedChapters by lazy {
|
||||
chapters.applyFilters(manga).toList()
|
||||
// KMK -->
|
||||
// safe-guard some edge-cases where chapters are duplicated some how on a merged entry
|
||||
.distinctBy { it.id }
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
val isAnySelected by lazy {
|
||||
|
|
|
|||
Loading…
Reference in a new issue