Skip to content

Commit 407ac39

Browse files
committed
DROID-2966 Chats | Fix | Highlight message design fixes - hotfix (#2561)
1 parent b7aa3bd commit 407ac39

File tree

1 file changed

+5
-6
lines changed
  • feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/presentation

1 file changed

+5
-6
lines changed

feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/presentation/ChatViewModel.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
7676
import kotlinx.coroutines.flow.MutableStateFlow
7777
import kotlinx.coroutines.flow.combine
7878
import kotlinx.coroutines.flow.distinctUntilChanged
79-
import kotlinx.coroutines.flow.flowOf
8079
import kotlinx.coroutines.flow.flowOn
8180
import kotlinx.coroutines.flow.map
8281
import 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

Comments
 (0)