diff --git a/app/api/chat-stream/route.ts b/app/api/chat-stream/route.ts index 8803a42..ad40c6b 100644 --- a/app/api/chat-stream/route.ts +++ b/app/api/chat-stream/route.ts @@ -1,4 +1,3 @@ -import type { ChatRequest } from "../chat/typing"; import { createParser } from "eventsource-parser"; import { NextRequest } from "next/server"; diff --git a/app/components/home.tsx b/app/components/home.tsx index 1265149..ffe813e 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -465,6 +465,16 @@ function showMemoryPrompt(session: ChatSession) { }); } +const useHasHydrated = () => { + const [hasHydrated, setHasHydrated] = useState(false); + + useEffect(() => { + setHasHydrated(true); + }, []); + + return hasHydrated; +}; + export function Home() { const [createNewSession, currentIndex, removeSession] = useChatStore( (state) => [ @@ -473,7 +483,7 @@ export function Home() { state.removeSession, ] ); - const loading = !useChatStore?.persist?.hasHydrated(); + const loading = !useHasHydrated(); const [showSideBar, setShowSideBar] = useState(true); // setting diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 56165da..eb9bc6d 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -354,7 +354,7 @@ export function Settings(props: { closeSettings: () => void }) { updateConfig( diff --git a/app/components/userRole.tsx b/app/components/userRole.tsx new file mode 100644 index 0000000..e69de29