🐛 fix(im): 当前打开的会话在列表里不再展示 [草稿] 前缀

im
YunaiV 2026-05-07 21:55:45 +08:00
parent cc93b8a742
commit 7fa1dbc55c
1 changed files with 11 additions and 3 deletions

View File

@ -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)
/** 最后一条消息发送者的展示名:实时算 + 快照 fallbackgetSenderDisplayName 算不出时兜底) */