From e868d753bfd51927a5ee3af11b6c3831371ef6f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jun 2022 17:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerservice/support/conversation/index.jsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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)