MCPcopy Create free account
hub / github.com/codeaashu/claude-code / checkConnection

Function checkConnection

web/components/settings/ApiSettings.tsx:17–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 const [latencyMs, setLatencyMs] = useState<number | null>(null);
16
17 async function checkConnection() {
18 setConnectionStatus("checking");
19 setLatencyMs(null);
20 const start = Date.now();
21 try {
22 const res = await fetch(`${settings.apiUrl}/health`, { signal: AbortSignal.timeout(5000) });
23 const ms = Date.now() - start;
24 setLatencyMs(ms);
25 setConnectionStatus(res.ok ? "ok" : "error");
26 } catch {
27 setConnectionStatus("error");
28 }
29 }
30
31 const statusIcon = {
32 idle: null,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected