From bf37e191cb18b00b282ed981823911887a92da95 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Mon, 6 Nov 2023 13:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E8=BD=BD=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/store/chatStore.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/im-uniapp/store/chatStore.js b/im-uniapp/store/chatStore.js index 0cc1a6a..3358b23 100644 --- a/im-uniapp/store/chatStore.js +++ b/im-uniapp/store/chatStore.js @@ -35,9 +35,11 @@ export default { if (state.chats[i].type == chatInfo.type && state.chats[i].targetId === chatInfo.targetId) { chat = state.chats[i]; - // 放置头部 - state.chats.splice(i, 1); - state.chats.unshift(chat); + // 放置头部(这个操作非常耗资源,正在加载消息时不执行) + if(!state.loadingPrivateMsg && !state.loadingPrivateMsg){ + state.chats.splice(i, 1); + state.chats.unshift(chat); + } break; } }