mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-09 01:45:51 +00:00
remove other sections when jump to bottom clicked
This commit is contained in:
@@ -1347,7 +1347,13 @@ fun BoxWithConstraintsScope.ChatItemsList(
|
||||
scope.launch {
|
||||
listState.animateScrollToItem(0)
|
||||
preloadItemsEnabled.value = true
|
||||
// TODO: Remove other sections and items.
|
||||
|
||||
val bottomSection = sections.find { it.area == ChatSectionArea.Bottom }
|
||||
if (bottomSection != null && sections.size > 1) {
|
||||
val removeTo = chatModel.chatItems.value.size - 1 - bottomSection.boundary.maxIndex
|
||||
chatModel.chatItems.value.removeRange(fromIndex = 0, toIndex = removeTo)
|
||||
chatModel.chatItemsSectionArea = mutableMapOf<Long, ChatSectionArea>().also { it.putAll(chatModel.chatItems.value.associate { it.id to ChatSectionArea.Bottom }) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user