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