MCPcopy
hub / github.com/Zleap-AI/SAG / refreshSessionsForProjects

Function refreshSessionsForProjects

web/src/App.tsx:425–446  ·  view source on GitHub ↗
(projectIds: string[])

Source from the content-addressed store, hash-verified

423 }
424
425 async function refreshSessionsForProjects(projectIds: string[]) {
426 const uniqueProjectIds = [...new Set(projectIds.filter(Boolean))];
427 if (uniqueProjectIds.length === 0) {
428 setSessionsByProjectId({});
429 return;
430 }
431 try {
432 const entries = await Promise.all(uniqueProjectIds.map(async (projectId) => {
433 const response = await api.listMcpSessions(projectId);
434 return [projectId, response.sessions] as const;
435 }));
436 setSessionsByProjectId((current) => {
437 const next = { ...current };
438 for (const [projectId, projectSessions] of entries) {
439 next[projectId] = projectSessions;
440 }
441 return next;
442 });
443 } catch (err) {
444 setError(getErrorMessage(err));
445 }
446 }
447
448 async function clearModelLogs() {
449 try {

Callers 3

bootstrapFunction · 0.85
loadProjectsFunction · 0.85
sendMcpMessageFunction · 0.85

Calls 1

getErrorMessageFunction · 0.70

Tested by

no test coverage detected