fix(extensions): Crash when the same extension appears multiple times in the list

This commit is contained in:
jmir1 2024-01-17 13:22:45 +01:00
parent 00883792cd
commit 4fe7681992
No known key found for this signature in database
GPG key ID: 7B3B624787A072BD
2 changed files with 4 additions and 2 deletions

View file

@ -38,6 +38,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import eu.kanade.core.util.fastDistinctBy
import eu.kanade.presentation.browse.BaseBrowseItem
import eu.kanade.presentation.browse.anime.components.AnimeExtensionIcon
import eu.kanade.presentation.browse.manga.ExtensionHeader
@ -185,7 +186,7 @@ private fun AnimeExtensionContent(
}
items(
items = items,
items = items.fastDistinctBy { it.hashCode() },
contentType = { "item" },
key = { "extension-${it.hashCode()}" },
) { item ->

View file

@ -41,6 +41,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import dev.icerock.moko.resources.StringResource
import eu.kanade.core.util.fastDistinctBy
import eu.kanade.presentation.browse.BaseBrowseItem
import eu.kanade.presentation.browse.manga.components.MangaExtensionIcon
import eu.kanade.presentation.components.WarningBanner
@ -187,7 +188,7 @@ private fun ExtensionContent(
}
items(
items = items,
items = items.fastDistinctBy { it.hashCode() },
contentType = { "item" },
key = { "extension-${it.hashCode()}" },
) { item ->