MCPcopy Create free account
hub / github.com/TanStack/ai / handleNewChat

Function handleNewChat

examples/ts-react-chat/src/routes/threads.tsx:252–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 }, [loaded, activeId, threads.length])
251
252 const handleNewChat = () => {
253 // Don't pile up empty chats — if an untouched "New chat" exists, focus it.
254 const empty = threads.find((t) => t.title === NEW_CHAT_TITLE)
255 setActiveId(empty ? empty.id : createThread().id)
256 }
257
258 const handleDelete = (id: string) => {
259 deleteThread(id)

Callers

nothing calls this directly

Calls 1

createThreadFunction · 0.85

Tested by

no test coverage detected