fix(hook): 🐛 修复发送消息频繁的bug

This commit is contained in:
ZOL4789 2024-11-16 12:24:58 +08:00
parent 153896480e
commit bbb74ee78a

View File

@ -203,10 +203,10 @@ export const useMsgInput = (messageInputDom: Ref) => {
msgType: msg.type,
body: { content: msg.content, replyMsgId: msg.reply !== 0 ? msg.reply : undefined }
})
.then(async (res) => {
if (res.message.type === MsgEnum.TEXT) {
await chatStore.pushMsg(res)
}
.then(async () => {
// if (res.message.type === MsgEnum.TEXT) {
// await chatStore.pushMsg(res)
// }
// 发完消息就要刷新会话列表,
// FIXME 如果当前会话已经置顶了,可以不用刷新
chatStore.updateSessionLastActiveTime(globalStore.currentSession.roomId)