MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / fetchVersion

Function fetchVersion

website/src/components/Footer.tsx:23–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 const [version, setVersion] = useState("");
22 useEffect(() => {
23 async function fetchVersion() {
24 try {
25 const res = await fetch(
26 "https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/README.md"
27 );
28 if (!res.ok) throw new Error("Failed to fetch README");
29
30 const text = await res.text();
31 const match = text.match(
32 /\*\*Version:\*\*\s*([0-9]+\.[0-9]+\.[0-9]+)/i
33 );
34 setVersion(match ? match[1] : "N/A");
35 } catch (err) {
36 console.error(err);
37 setVersion("N/A");
38 }
39 }
40
41 fetchVersion();
42 }, []);

Callers 1

FooterFunction · 0.70

Calls 2

errorMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected