MCPcopy Create free account
hub / github.com/Roy3838/Observer / fetchCapture

Function fetchCapture

app/src/hooks/useIterations.ts:108–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106
107 useEffect(() => {
108 const fetchCapture = () => {
109 const iterations = IterationStore.getIterationsForAgent(agentId);
110 const last = iterations[iterations.length - 1];
111 const key = last ? `${last.id}-${last.modelImages?.length ?? 0}` : '';
112 if (key === keyRef.current) return;
113 keyRef.current = key;
114 setCapture(last ? { image: last.modelImages?.[0], prompt: last.modelPrompt } : {});
115 };
116
117 fetchCapture();
118 const interval = setInterval(fetchCapture, pollInterval);

Callers 1

useLastCaptureFunction · 0.85

Calls 1

getIterationsForAgentMethod · 0.80

Tested by

no test coverage detected