fix(android): attempt to workaround duplicate item keys bug

Fixes COMPOSE-LOBSTERS-2E
This commit is contained in:
Harsh Shandilya 2024-06-05 13:12:52 +05:30
parent 81f4d35f93
commit 9c07169b1b

View file

@ -63,7 +63,7 @@ fun NetworkPosts(
LazyColumn(state = listState) {
items(
count = lazyPagingItems.itemCount,
key = lazyPagingItems.itemKey { it.shortId },
key = lazyPagingItems.itemKey { item -> "${item.shortId}-${item.hashCode()}" },
contentType = lazyPagingItems.itemContentType { "LobstersItem" },
) { index ->
val item = lazyPagingItems[index]