()
| 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); |
no test coverage detected