From 1305bfac59ef74befafb0dd9fde41a5b4b48695e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Mon, 8 Sep 2025 10:32:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(weChat):=20=E7=A7=BB=E9=99=A4=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81=E7=9A=84=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除setTimeout延迟设置messagesLoading为false的逻辑,改为在try和finally块中直接设置,避免不必要的延迟 --- Cunkebao/src/store/module/weChat/weChat.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Cunkebao/src/store/module/weChat/weChat.ts b/Cunkebao/src/store/module/weChat/weChat.ts index 2941c710..b48102e2 100644 --- a/Cunkebao/src/store/module/weChat/weChat.ts +++ b/Cunkebao/src/store/module/weChat/weChat.ts @@ -91,12 +91,11 @@ export const useWeChatStore = create()( }); } } + set({ messagesLoading: false }); } catch (error) { console.error("获取聊天消息失败:", error); } finally { - setTimeout(() => { - set({ messagesLoading: false }); - }, 1500); + set({ messagesLoading: false }); } },