perf: 优化聊天体验,移除发送图片和文件后的重新加载
This commit is contained in:
parent
2a7da14df5
commit
ce6a0d41eb
@ -1661,9 +1661,8 @@ const handleImage = async (imageData: any) => {
|
||||
// 使用服务器返回的真实ID更新最后读取消息ID
|
||||
await updateLastReadMessage(imageMessage.id)
|
||||
|
||||
// 重新加载消息列表以确认服务器存储的数据
|
||||
console.log('🔄 重新加载消息列表以确认服务器数据...')
|
||||
await loadMessages(activeContactId.value)
|
||||
// 不需要重新加载消息列表,因为消息已经添加到本地列表
|
||||
console.log('✅ 图片消息发送成功,无需重新加载')
|
||||
} else {
|
||||
console.warn('⚠️ 服务器未返回图片消息ID,跳过更新最后读取消息')
|
||||
}
|
||||
@ -1786,9 +1785,8 @@ const handleFile = async (fileData: any) => {
|
||||
// 使用服务器返回的真实ID更新最后读取消息ID
|
||||
await updateLastReadMessage(fileMessage.id)
|
||||
|
||||
// 重新加载消息列表以确认服务器存储的数据
|
||||
console.log('🔄 重新加载消息列表以确认服务器数据...')
|
||||
await loadMessages(activeContactId.value)
|
||||
// 不需要重新加载消息列表,因为消息已经添加到本地列表
|
||||
console.log('✅ 文件消息发送成功,无需重新加载')
|
||||
} else {
|
||||
console.warn('⚠️ 服务器未返回文件消息ID,跳过更新最后读取消息')
|
||||
}
|
||||
@ -2442,7 +2440,7 @@ onMounted(() => {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 315px;
|
||||
height: 76%;
|
||||
height: 77%;
|
||||
background: #ffffff;
|
||||
z-index: 10;
|
||||
animation: slideInRight 0.3s ease-out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user