🐛 fix(im): 当前打开的会话在列表里不再展示 [草稿] 前缀
parent
cc93b8a742
commit
7fa1dbc55c
|
|
@ -107,15 +107,23 @@ const uiStore = useImUiStore()
|
||||||
const draftStore = useDraftStore()
|
const draftStore = useDraftStore()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
/** 当前会话的草稿快照:存在时列表显示 [草稿] 前缀 + plain 文本,盖掉 sender 前缀和 @我 红字 */
|
|
||||||
const draft = computed(() => draftStore.getDraft(props.conversation))
|
|
||||||
|
|
||||||
const isActive = computed(
|
const isActive = computed(
|
||||||
() =>
|
() =>
|
||||||
conversationStore.activeConversation?.targetId === props.conversation.targetId &&
|
conversationStore.activeConversation?.targetId === props.conversation.targetId &&
|
||||||
conversationStore.activeConversation?.type === props.conversation.type
|
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)
|
const isGroup = computed(() => props.conversation.type === ImConversationType.GROUP)
|
||||||
|
|
||||||
/** 最后一条消息发送者的展示名:实时算 + 快照 fallback(getSenderDisplayName 算不出时兜底) */
|
/** 最后一条消息发送者的展示名:实时算 + 快照 fallback(getSenderDisplayName 算不出时兜底) */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue