From e2de454426cc15df6009f02af84ecdd8f3e22349 Mon Sep 17 00:00:00 2001 From: Diogo Date: Thu, 31 Oct 2024 13:24:56 +0000 Subject: [PATCH] fix mark read for ranges --- .../kotlin/chat/simplex/common/views/chat/ChatView.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index c38df7704f..a90e051eb4 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -1346,7 +1346,14 @@ fun BoxWithConstraintsScope.ChatItemsList( LaunchedEffect(cItem.id) { scope.launch { delay(600) - markRead(CC.ItemRange(cItem.id, cItem.id), null) + val range = if (sectionItems.mergeCategory != null) { + val firstItem = sectionItems.items.first() + val lastItem = sectionItems.items.last() + CC.ItemRange(lastItem.id, firstItem.id) + } else { + CC.ItemRange(cItem.id, cItem.id) + } + markRead(range, null) } } }