mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-01 22:18:43 +00:00
safe get for lastVisibleItem
This commit is contained in:
+2
-2
@@ -1425,9 +1425,9 @@ fun BoxWithConstraintsScope.FloatingButtons(
|
||||
|
||||
val lastVisibleItem by remember {
|
||||
derivedStateOf {
|
||||
if (lastIndexOfVisibleItems >= 0) {
|
||||
if (lastIndexOfVisibleItems >= 0 && firstVisibleIndex >= 0) {
|
||||
val lastVisibleChatItemIndex = chatItems.value.lastIndex - firstVisibleIndex - lastIndexOfVisibleItems
|
||||
chatItems.value[lastVisibleChatItemIndex]
|
||||
chatItems.value.getOrNull(lastVisibleChatItemIndex)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user