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

Function loadSessions

src/stores/session.ts:166–179  ·  view source on GitHub ↗

* 从数据库加载会话列表

()

Source from the content-addressed store, hash-verified

164 * 从数据库加载会话列表
165 */
166 async function loadSessions() {
167 try {
168 const list = await useDataService().getSessions()
169 sessions.value = list
170 // 如果当前选中的会话不存在了,清除选中状态
171 if (currentSessionId.value && !list.find((s) => s.id === currentSessionId.value)) {
172 currentSessionId.value = null
173 }
174 isInitialized.value = true
175 } catch (error) {
176 console.error('加载会话列表失败:', error)
177 isInitialized.value = true
178 }
179 }
180
181 /**
182 * 选择文件并导入

Callers 4

importFileFromPathFunction · 0.85
importFilesFromPathsFunction · 0.85
mergeImportFilesFunction · 0.85
deleteSessionFunction · 0.85

Calls 3

useDataServiceFunction · 0.90
getSessionsMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected