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

Function handleDelete

examples/ts-react-chat/src/routes/threads.tsx:258–265  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

256 }
257
258 const handleDelete = (id: string) => {
259 deleteThread(id)
260 if (id === activeId) {
261 const next = threads.find((t) => t.id !== id)
262 // If nothing remains the bootstrap effect creates a fresh thread.
263 setActiveId(next ? next.id : null)
264 }
265 }
266
267 return (
268 <div className="flex h-[calc(100vh-72px)] bg-gray-900 text-white">

Callers 1

ThreadsRouteFunction · 0.85

Calls 1

deleteThreadFunction · 0.85

Tested by

no test coverage detected