todo: 获取会话列表, 多个顾问ID

dev/chat
Lei OT 2 years ago
parent ec16147001
commit f67ff2b29f

@ -301,10 +301,10 @@ export const useConversationStore = create(
setInitial: (v) => set({ initialState: v }),
// side effects
fetchInitialData: async (userId) => {
const { addToConversationList, setTemplates, setInitial, receivedMessageList } = get();
fetchInitialData: async (userIds) => {
const { addToConversationList, setTemplates, setInitial, } = get();
const conversationsList = await fetchConversationsList({ opisn: userId });
const conversationsList = await fetchConversationsList({ opisn: userIds });
addToConversationList(conversationsList);
const templates = await fetchTemplates();

@ -21,7 +21,7 @@ function AuthApp() {
const navigate = useNavigate()
const { colorPrimary, borderRadius } = useThemeContext()
const { loginUser } = useAuthStore()
const loginUser = useAuthStore(state => state.loginUser)
const href = useHref()
@ -36,7 +36,7 @@ function AuthApp() {
useEffect(() => {
if (loginUser.userId > 0) {
useConversationStore.getState().connectWebsocket(loginUser.userId);
useConversationStore.getState().fetchInitialData(loginUser.userId);
useConversationStore.getState().fetchInitialData(loginUser.userId); // userIdStr
}
return () => {
useConversationStore.getState().disconnectWebsocket();

Loading…
Cancel
Save