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