Frontend: use github-versions.json for version display (#11281)

* fix(frontend): use github-versions.json for version display

- Update AppVersion type to match new format with slug field
- Switch from versions.json to github-versions.json API
- Simplify version matching by direct slug comparison
- Remove 'Loading versions...' text - show nothing if no version found

* feat(frontend): show tooltip for pinned versions

* fix(api): add github-versions endpoint and fix legacy versions route
This commit is contained in:
CanbiZ (MickLesk)
2026-01-28 14:29:26 +01:00
committed by GitHub
parent 2434e0ab3b
commit c7669c39c3
6 changed files with 75 additions and 23 deletions

View File

@@ -2,7 +2,7 @@
import { useQuery } from "@tanstack/react-query";
import type { AppVersion } from "@/lib/types";
import type { AppVersion, GitHubVersionsResponse } from "@/lib/types";
import { fetchVersions } from "@/lib/data";
@@ -10,14 +10,8 @@ export function useVersions() {
return useQuery<AppVersion[]>({
queryKey: ["versions"],
queryFn: async () => {
const fetchedVersions = await fetchVersions();
if (Array.isArray(fetchedVersions)) {
return fetchedVersions;
}
if (fetchedVersions && typeof fetchedVersions === "object") {
return [fetchedVersions];
}
return [];
const response: GitHubVersionsResponse = await fetchVersions();
return response.versions ?? [];
},
});
}