Skip to content

Commit

Permalink
Use Set urls to prevent keys duplicated in lazy column
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcoding810 committed Feb 22, 2025
1 parent dd26979 commit f7312e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fun ImageList(
state = listState,
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
items(uiState.images, key = { it }) { image ->
items(uiState.images.toList(), key = { it }) { image ->
PostImage(url = image) {
viewModel.toggleSystemBarHidden()
selectedImage = image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PostViewModel(private val postUrl: String, siteConfig: SiteConfig) : ViewM
)

data class UiState(
val images: List<String> = listOf(),
val images: Set<String> = setOf(),
val postPage: Int = 1,
val postTotalPage: Int = 1,
val nextPage: String? = null,
Expand Down

0 comments on commit f7312e2

Please sign in to comment.