mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
一个略有问题的修复
This commit is contained in:
@@ -2831,28 +2831,22 @@ function ChatPage(props: ChatPageProps) {
|
|||||||
if (gen !== inSessionSearchGenRef.current) return
|
if (gen !== inSessionSearchGenRef.current) return
|
||||||
const messages = res?.messages || []
|
const messages = res?.messages || []
|
||||||
|
|
||||||
// 查询完整消息信息
|
// 补充联系人信息
|
||||||
const enriched = await Promise.all(
|
const enriched = await Promise.all(
|
||||||
messages.map(async (msg: any) => {
|
messages.map(async (msg: any) => {
|
||||||
try {
|
if (msg.senderUsername) {
|
||||||
const full = await window.electronAPI.chat.getMessages(sid, 0, 3, msg.createTime, msg.createTime, false)
|
try {
|
||||||
const found: any = full?.messages?.find((m: any) => m.localId === msg.localId)
|
const contact = await window.electronAPI.chat.getContact(msg.senderUsername)
|
||||||
if (found && found.senderUsername) {
|
if (contact) {
|
||||||
try {
|
msg.senderDisplayName = contact.remark || contact.nickName || msg.senderUsername
|
||||||
const contact = await window.electronAPI.chat.getContact(found.senderUsername)
|
}
|
||||||
if (contact) {
|
const avatarData = await window.electronAPI.chat.getContactAvatar(msg.senderUsername)
|
||||||
found.senderDisplayName = contact.remark || contact.nickName || found.senderUsername
|
if (avatarData?.avatarUrl) {
|
||||||
}
|
msg.senderAvatarUrl = avatarData.avatarUrl
|
||||||
const avatarData = await window.electronAPI.chat.getContactAvatar(found.senderUsername)
|
}
|
||||||
if (avatarData?.avatarUrl) {
|
} catch {}
|
||||||
found.senderAvatarUrl = avatarData.avatarUrl
|
|
||||||
}
|
|
||||||
} catch {}
|
|
||||||
}
|
|
||||||
return found || msg
|
|
||||||
} catch {
|
|
||||||
return msg
|
|
||||||
}
|
}
|
||||||
|
return msg
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user