mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
ImageViewer fix delete picture crash (#3039)
This commit is contained in:
@@ -97,12 +97,15 @@ fun MemoryScreen(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
items(items = shuffledIndices) { index ->
|
||||
Box(Modifier.size(130.dp).clip(RoundedCornerShape(8.dp))) {
|
||||
SquareThumbnail(
|
||||
picture = pictures[index],
|
||||
isHighlighted = false,
|
||||
onClick = { onSelectRelatedMemory(index) }
|
||||
)
|
||||
val relatedPicture = pictures.getOrNull(index)
|
||||
if (relatedPicture != null) {
|
||||
Box(Modifier.size(130.dp).clip(RoundedCornerShape(8.dp))) {
|
||||
SquareThumbnail(
|
||||
picture = relatedPicture,
|
||||
isHighlighted = false,
|
||||
onClick = { onSelectRelatedMemory(index) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user