diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index 11da8b874e..0853fa709d 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -779,10 +779,9 @@ object ChatModel { } } - val popChatCollector = PopChatCollector(this) + val popChatCollector = PopChatCollector() - // TODO [contexts] no reason for this to be nested? - class PopChatCollector(chatsCtx: ChatsContext) { + inner class PopChatCollector { private val subject = MutableSharedFlow() private var remoteHostId: Long? = null private val chatsToPop = mutableMapOf() @@ -793,7 +792,7 @@ object ChatModel { .throttleLatest(2000) .collect { withContext(Dispatchers.Main) { - chatsCtx.chats.replaceAll(popCollectedChats()) + chats.replaceAll(popCollectedChats()) } } }