fix(weChat): 移除消息加载状态的延迟设置
移除setTimeout延迟设置messagesLoading为false的逻辑,改为在try和finally块中直接设置,避免不必要的延迟
This commit is contained in:
@@ -91,12 +91,11 @@ export const useWeChatStore = create<WeChatState>()(
|
||||
});
|
||||
}
|
||||
}
|
||||
set({ messagesLoading: false });
|
||||
} catch (error) {
|
||||
console.error("获取聊天消息失败:", error);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
set({ messagesLoading: false });
|
||||
}, 1500);
|
||||
set({ messagesLoading: false });
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user