screenshots: filter out dupes & used stable id

This commit is contained in:
Rahul Patel
2026-05-19 22:49:38 +05:30
parent 8c51175312
commit fa0e3c53d1

View File

@@ -40,6 +40,7 @@ fun ScreenshotScreen(
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
) {
val app by viewModel.app.collectAsStateWithLifecycle()
val screenshots = app?.screenshots ?: emptyList()
val topAppBarTitle = when {
windowAdaptiveInfo.isWindowCompact -> app!!.displayName
@@ -48,7 +49,7 @@ fun ScreenshotScreen(
ScreenContent(
topAppBarTitle = topAppBarTitle,
screenshots = app!!.screenshots,
screenshots = screenshots.distinctBy { it.url },
index = index
)
}
@@ -79,7 +80,8 @@ private fun ScreenContent(
modifier = Modifier
.padding(paddingValues)
.fillMaxSize(),
state = pagerState
state = pagerState,
key = { screenshots[it].url }
) { page ->
val artwork = screenshots[page]
ScreenshotListItem(