From 7e9ab7cd85b2c20ded943942eaccb3170d9e9081 Mon Sep 17 00:00:00 2001 From: Diogo Date: Thu, 31 Oct 2024 16:02:00 +0000 Subject: [PATCH] avoid recompose when revealed is clean --- .../kotlin/chat/simplex/common/views/chat/ChatView.kt | 4 +++- 1 file changed, 3 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 a25afda5a4..bb3f4a24ed 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 @@ -1019,7 +1019,9 @@ fun BoxWithConstraintsScope.ChatItemsList( snapshotFlow { chatModel.chatId.value } .distinctUntilChanged() .collect { - revealedItems.value = setOf() + if (revealedItems.value.isNotEmpty()) { + revealedItems.value = setOf() + } preloadItemsEnabled.value = true val firstUnreadItem = reversedChatItems.findLast { it.isRcvNew } if (firstUnreadItem != null) {