From f4e2ccc9dcb3ed198645db7be50858695946665a Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Sat, 28 Mar 2026 12:27:21 +0000 Subject: [PATCH] fix: jump to message in search fails for messages high up in timeline (#6714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closeSearch() added onSearchValueChanged("") in d30dde5 (content filter feature) which triggers async apiFindMessages — this clears the items that openChat just loaded around the target and replaces them with initial messages. Skip the reload when openAroundItemId is already set. --- .../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 f8ae03c5dd..4e4b1f298d 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 @@ -753,7 +753,9 @@ fun ChatView( changeNtfsState = { enabled, currentValue -> toggleNotifications(chatRh, chatInfo, enabled, chatModel, currentValue) }, onSearchValueChanged = onSearchValueChanged, closeSearch = { - onSearchValueChanged("") + if (chatModel.openAroundItemId.value == null) { + onSearchValueChanged("") + } showSearch.value = false searchText.value = "" contentFilter.value = null