From 7fa1dbc55cf7b466cb5321a73d91dbb68427dce1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 7 May 2026 21:55:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(im):=20=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E4=BC=9A=E8=AF=9D=E5=9C=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=87=8C=E4=B8=8D=E5=86=8D=E5=B1=95=E7=A4=BA=20[?= =?UTF-8?q?=E8=8D=89=E7=A8=BF]=20=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/conversation/ConversationItem.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue b/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue index 2d3157ea1..12edd6db0 100644 --- a/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue +++ b/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue @@ -107,15 +107,23 @@ const uiStore = useImUiStore() const draftStore = useDraftStore() const message = useMessage() -/** 当前会话的草稿快照:存在时列表显示 [草稿] 前缀 + plain 文本,盖掉 sender 前缀和 @我 红字 */ -const draft = computed(() => draftStore.getDraft(props.conversation)) - const isActive = computed( () => conversationStore.activeConversation?.targetId === props.conversation.targetId && conversationStore.activeConversation?.type === props.conversation.type ) +/** + * 当前会话的草稿快照:存在时列表显示 [草稿] 前缀 + plain 文本,盖掉 sender 前缀和 @我 红字 + * 当前打开的会话不展示草稿;输入内容已经在编辑器里可见,列表再显示 [草稿] 反而冗余 + */ +const draft = computed(() => { + if (isActive.value) { + return undefined + } + return draftStore.getDraft(props.conversation) +}) + const isGroup = computed(() => props.conversation.type === ImConversationType.GROUP) /** 最后一条消息发送者的展示名:实时算 + 快照 fallback(getSenderDisplayName 算不出时兜底) */