MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / deleteSession

Function deleteSession

src/stores/session.ts:626–644  ·  view source on GitHub ↗

* 删除会话

(id: string)

Source from the content-addressed store, hash-verified

624 * 删除会话
625 */
626 async function deleteSession(id: string): Promise<boolean> {
627 try {
628 const success = await useDataService().deleteSession(id)
629 if (success) {
630 const index = sessions.value.findIndex((s) => s.id === id)
631 if (index !== -1) {
632 sessions.value.splice(index, 1)
633 }
634 if (currentSessionId.value === id) {
635 currentSessionId.value = null
636 }
637 await loadSessions()
638 }
639 return success
640 } catch (error) {
641 console.error('删除会话失败:', error)
642 return false
643 }
644 }
645
646 /**
647 * 重命名会话

Callers

nothing calls this directly

Calls 4

useDataServiceFunction · 0.90
loadSessionsFunction · 0.85
deleteSessionMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected