Revert "fix(android): remove explicit item keys"

This causes subtle UI artifacts that make me more annoyed than the occasional crash.

This reverts commit 2a97383e7d.
This commit is contained in:
Harsh Shandilya 2023-07-14 19:08:32 +05:30
parent fd8b65be72
commit 2a3514e3b5
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View file

@ -56,6 +56,7 @@ fun DatabasePosts(
stickyHeader(contentType = "month-header") { MonthHeader(month = month) }
items(
items = posts,
key = { it.shortId },
contentType = { "LobstersItem" },
) { item ->
ListItem(

View file

@ -28,6 +28,7 @@ import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import dev.msfjarvis.claw.common.posts.PostActions
import dev.msfjarvis.claw.common.posts.toDbModel
import dev.msfjarvis.claw.common.ui.NetworkError
@ -61,6 +62,7 @@ fun NetworkPosts(
) {
items(
count = lazyPagingItems.itemCount,
key = lazyPagingItems.itemKey { it.shortId },
contentType = lazyPagingItems.itemContentType { "LobstersItem" },
) { index ->
val item = lazyPagingItems[index]