mirror of
https://gitee.com/lijingbo-2021/open-anylink-web.git
synced 2025-12-30 02:52:26 +00:00
转发消息缺少提示音
This commit is contained in:
@@ -3,22 +3,31 @@ import msgSend from '@/assets/audio/msgsend.mp3'
|
||||
import { useUserStore } from '@/stores'
|
||||
const userData = useUserStore()
|
||||
|
||||
let playMsgReceiveTimer
|
||||
export const playMsgReceive = () => {
|
||||
if (!userData.user.newMsgTips) {
|
||||
return
|
||||
}
|
||||
const audio = new Audio(msgReceive)
|
||||
audio.play().catch(() => {
|
||||
// do nothing
|
||||
})
|
||||
clearTimeout(playMsgReceiveTimer)
|
||||
playMsgReceiveTimer = setTimeout(() => {
|
||||
const audio = new Audio(msgReceive)
|
||||
audio.play().catch(() => {
|
||||
// do nothing
|
||||
})
|
||||
}, 300)
|
||||
}
|
||||
|
||||
let playMsgSendTimer
|
||||
export const playMsgSend = () => {
|
||||
if (!userData.user.sendMsgTips) {
|
||||
return
|
||||
}
|
||||
const audio = new Audio(msgSend)
|
||||
audio.play().catch(() => {
|
||||
// do nothing
|
||||
})
|
||||
|
||||
clearTimeout(playMsgSendTimer)
|
||||
playMsgSendTimer = setTimeout(() => {
|
||||
const audio = new Audio(msgSend)
|
||||
audio.play().catch(() => {
|
||||
// do nothing
|
||||
})
|
||||
}, 300)
|
||||
}
|
||||
|
||||
@@ -673,6 +673,10 @@ const handleSendForwardMsg = async ({ session, content, contentType }) => {
|
||||
|
||||
const after = (msgId) => {
|
||||
messageData.updateMsg(msg.sessionId, msg.msgId, { msgId, status: msgSendStatus.OK })
|
||||
|
||||
if (!messageData.sessionList[msg.sessionId].dnd) {
|
||||
playMsgSend()
|
||||
}
|
||||
}
|
||||
wsConnect.sendMsg(
|
||||
msg.sessionId,
|
||||
|
||||
Reference in New Issue
Block a user