Skip to content

Commit

Permalink
Use correct version information (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiemh authored Mar 3, 2024
1 parent d3c9e46 commit 1383ed3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/Version/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ function Version(): JSX.Element | null {

useEffect(() => {
const fetchVersion = async () => {
const result = await fetch("https://crates.io/api/v1/crates/surrealdb/versions");
const data = await result.json();

setVersion(data["versions"][0]["num"]);
const result = await fetch("https://version.surrealdb.com");
const data = await result.text();
setVersion(data);
};

fetchVersion();
Expand All @@ -18,7 +17,7 @@ function Version(): JSX.Element | null {
return null;
}

return <code>v{version}</code>;
return <code>{version}</code>;
}

export default React.memo(Version);

0 comments on commit 1383ed3

Please sign in to comment.