mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 02:54:34 +00:00
one more
This commit is contained in:
+1
-1
@@ -236,7 +236,7 @@ fun landingSectionToArea(chatLandingSection: ChatLandingSection) = when (chatLan
|
||||
ChatLandingSection.Unread -> ChatSectionArea.Current
|
||||
}
|
||||
|
||||
suspend fun apiLoadBottomSection(chatInfo: ChatInfo, chatModel: ChatModel, rhId: Long?) {
|
||||
suspend fun apiLoadBottomSection(chatInfo: ChatInfo, rhId: Long?) {
|
||||
val chat = chatController.apiGetChat(rh = rhId, type = chatInfo.chatType, id = chatInfo.apiId)
|
||||
if (chatModel.chatId.value != chatInfo.id || chat == null) return
|
||||
withContext(Dispatchers.Main) {
|
||||
|
||||
+2
-2
@@ -1002,6 +1002,7 @@ fun BoxScope.ChatItemsList(
|
||||
|
||||
val topPaddingToContentPx = rememberUpdatedState(with(LocalDensity.current) { topPaddingToContent().roundToPx() })
|
||||
val maxHeight = remember { derivedStateOf { listState.layoutInfo.viewportEndOffset - topPaddingToContentPx.value } }
|
||||
val chatInfoUpdated = rememberUpdatedState(chatInfo)
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
launch {
|
||||
@@ -1023,7 +1024,7 @@ fun BoxScope.ChatItemsList(
|
||||
withBGApi {
|
||||
scrollAdjustmentEnabled.value = false
|
||||
try {
|
||||
apiLoadBottomSection(chatInfo, chatModel, remoteHostId)
|
||||
apiLoadBottomSection(chatInfoUpdated.value, remoteHostId)
|
||||
} finally {
|
||||
delay(600)
|
||||
scrollAdjustmentEnabled.value = true
|
||||
@@ -1034,7 +1035,6 @@ fun BoxScope.ChatItemsList(
|
||||
}
|
||||
}
|
||||
}
|
||||
val chatInfoUpdated = rememberUpdatedState(chatInfo)
|
||||
val scrollToItem: State<(Long) -> Unit> = remember {
|
||||
mutableStateOf({ itemId: Long ->
|
||||
val index = sections.value.chatItemPosition(itemId)
|
||||
|
||||
Reference in New Issue
Block a user