MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / load

Function load

frontend/dashboard/src/components/Explainer.tsx:40–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 useEffect(() => {
39 let cancelled = false;
40 const load = async () => {
41 const payload = await fetchTraces(30);
42 if (cancelled) return;
43 if (!payload) {
44 setError("[ERROR: TRACE ENDPOINT UNREACHABLE]");
45 setRecent([]);
46 return;
47 }
48 setError(null);
49 setRecent(payload.items);
50 setSelectedId((current) => {
51 if (current && payload.items.some((item) => item.request_id === current)) return current;
52 return payload.items[0]?.request_id ?? null;
53 });
54 };
55 load();
56 return () => {
57 cancelled = true;

Callers 3

ExplainerFunction · 0.70
RoutingFunction · 0.70
ConnectionsFunction · 0.70

Calls 1

fetchTracesFunction · 0.90

Tested by

no test coverage detected