Fix emoji crash

This commit is contained in:
Aleksandras Kostarevas 2024-06-08 20:44:40 +03:00
parent 73c355fdf6
commit 513c08d39f

View File

@ -465,7 +465,7 @@ private fun EmojiCategoriesContainer(
val idx = categories.indexOf(activeCategoryItem)
if(idx != -1) {
val visibleSize = listState.layoutInfo.viewportEndOffset
val itemWidth = listState.layoutInfo.visibleItemsInfo.first().size
val itemWidth = listState.layoutInfo.visibleItemsInfo.firstOrNull()?.size ?: return@LaunchedEffect
listState.animateScrollToItem(idx, itemWidth / 2 - visibleSize / 2)
}
}