()
| 277 | let cancelled = false; |
| 278 | |
| 279 | async function loadDiagnostics() { |
| 280 | setIsLoadingDiagnostics(true); |
| 281 | try { |
| 282 | const report = await api<DiagnosticsReport>('/api/diagnostics'); |
| 283 | if (!cancelled) { |
| 284 | setDiagnosticsReport(report); |
| 285 | } |
| 286 | } catch (error) { |
| 287 | if (!cancelled) { |
| 288 | setErrorMessage(error instanceof Error ? error.message : String(error)); |
| 289 | } |
| 290 | } finally { |
| 291 | if (!cancelled) { |
| 292 | setIsLoadingDiagnostics(false); |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | void loadDiagnostics(); |
| 298 |