From 71f6e07e71a0ba6e6499512e3dd719a60f5d7314 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 7 May 2023 19:39:09 -0400 Subject: [PATCH] Don't compute key for browse list based on manga ID, which may be repeated Fixes #9473 --- .../browse/components/BrowseSourceComfortableGrid.kt | 6 +----- .../browse/components/BrowseSourceCompactGrid.kt | 6 +----- .../presentation/browse/components/BrowseSourceList.kt | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt index bbbb543ab..825c1c783 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems -import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaComfortableGridItem import kotlinx.coroutines.flow.StateFlow @@ -39,10 +38,7 @@ fun BrowseSourceComfortableGrid( } } - items( - count = mangaList.itemCount, - key = mangaList.itemKey { it.value.id }, - ) { index -> + items(count = mangaList.itemCount) { index -> val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceComfortableGridItem( manga = manga, diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt index a6b5027c4..cc2da0b37 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems -import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaCompactGridItem import kotlinx.coroutines.flow.StateFlow @@ -39,10 +38,7 @@ fun BrowseSourceCompactGrid( } } - items( - count = mangaList.itemCount, - key = mangaList.itemKey { it.value.id }, - ) { index -> + items(count = mangaList.itemCount) { index -> val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceCompactGridItem( manga = manga, diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt index f5f3ae701..5d7680c05 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt @@ -7,7 +7,6 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems -import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaListItem import kotlinx.coroutines.flow.StateFlow @@ -32,10 +31,7 @@ fun BrowseSourceList( } } - items( - count = mangaList.itemCount, - key = mangaList.itemKey { it.value.id }, - ) { index -> + items(count = mangaList.itemCount) { index -> val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceListItem( manga = manga,