From 12c1b348fe4187b2b9927786805f0bb058ebd991 Mon Sep 17 00:00:00 2001 From: Diogo Cunha Date: Wed, 17 Jul 2024 23:21:58 +0100 Subject: [PATCH] android, desktop: made sure contacts list refreshes on changes --- .../chat/simplex/common/views/contacts/ContactsView.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/contacts/ContactsView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/contacts/ContactsView.kt index 2de0f21577..8388b83e7c 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/contacts/ContactsView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/contacts/ContactsView.kt @@ -285,11 +285,9 @@ private fun ContactsList( } val showUnreadAndFavorites = remember { ChatController.appPrefs.showUnreadAndFavorites.state }.value - val allChats = remember { - contactChats( - chatModel.chats, - contactTypes - ) + + val allChats by remember(chatModel.chats, contactTypes) { + derivedStateOf { contactChats(chatModel.chats, contactTypes) } } val filteredContactChats = filteredContactChats( @@ -376,7 +374,6 @@ private fun filteredContactChats( searchText: String, contactChats: List ): List { - // TODO: Refresh list after delete. return contactChats .filter { chat -> filterChat( chat = chat,