@@ -76,7 +76,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
7676import kotlinx.coroutines.flow.MutableStateFlow
7777import kotlinx.coroutines.flow.combine
7878import kotlinx.coroutines.flow.distinctUntilChanged
79- import kotlinx.coroutines.flow.flowOf
8079import kotlinx.coroutines.flow.flowOn
8180import kotlinx.coroutines.flow.map
8281import kotlinx.coroutines.launch
@@ -302,11 +301,11 @@ class ChatViewModel @Inject constructor(
302301 val replyMessage = replies[replyToId]
303302 if (replyMessage != null ) {
304303 ChatView .Message .Reply (
305- msg = msg .id,
306- text = msg .content?.text.orEmpty().ifEmpty {
304+ msg = replyMessage .id,
305+ text = replyMessage .content?.text.orEmpty().ifEmpty {
307306 // Fallback to attachment name if empty
308- if (msg .attachments.isNotEmpty()) {
309- val attachment = msg .attachments.last()
307+ if (replyMessage .attachments.isNotEmpty()) {
308+ val attachment = replyMessage .attachments.last()
310309 val dependency = dependencies[attachment.target]
311310 val name = dependency?.name.orEmpty()
312311 val ext = dependency?.fileExt
@@ -322,7 +321,7 @@ class ChatViewModel @Inject constructor(
322321 author = allMembers.let { type ->
323322 when (type) {
324323 is Store .Data -> type.members.find { member ->
325- member.identity == msg .creator
324+ member.identity == replyMessage .creator
326325 }?.name.orEmpty()
327326 is Store .Empty -> " "
328327 }
0 commit comments