@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
16 lines (13 loc) • 562 B
text/typescript
import { useChatStore } from '@/store/chat';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
import { useSessionStore } from '@/store/session';
export const useFetchMessages = () => {
const isDBInited = useGlobalStore(systemStatusSelectors.isDBInited);
const [sessionId] = useSessionStore((s) => [s.activeId]);
const [activeTopicId, useFetchMessages] = useChatStore((s) => [
s.activeTopicId,
s.useFetchMessages,
]);
useFetchMessages(isDBInited, sessionId, activeTopicId);
};