消息提醒

This commit is contained in:
unknown
2022-06-10 17:36:31 +08:00
parent 8e2675fc7d
commit e868d753bf

View File

@ -316,15 +316,11 @@ const monitorWebSocket = (ws)=>{
ws.onmessage = function (res) { ws.onmessage = function (res) {
if(res.data){ if(res.data){
let data = JSON.parse(res.data) let data = JSON.parse(res.data)
if(window.isConversationURLChanged){//路由变化 if(window.isConversationURLChanged!= true){
window.msgAlertForCustomerService = true
showMsg()
}else {
if(window.isBlurForCustomerService){//失焦
showMsg()
}
setWsMsg(data) setWsMsg(data)
} }
window.msgAlertForCustomerService = true
showMsg()
} }
}; };
@ -359,7 +355,6 @@ useEffect(()=>{
window.isConversationURLChanged = isChanged window.isConversationURLChanged = isChanged
}else{ }else{
if(window.isConversationURLChanged != undefined){ //路由切换回来 if(window.isConversationURLChanged != undefined){ //路由切换回来
//stopMsg()
window.isConversationURLChanged = isChanged window.isConversationURLChanged = isChanged
} }
} }
@ -507,6 +502,7 @@ useEffect(() => {
setIsImgPreviewVisible(true) setIsImgPreviewVisible(true)
}} }}
reConnect={()=>{ reConnect={()=>{
setMsgList([])
websocketInit(staffId) websocketInit(staffId)
setLoading(true) setLoading(true)
getMoreMessage(1) getMoreMessage(1)