Attempt to make this work

This commit is contained in:
Mark Wylde
2025-05-31 00:59:31 +01:00
parent 5171232878
commit 1c309c8d10
2 changed files with 11 additions and 1 deletions

BIN
spinner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1,4 +1,14 @@
export const GITEA_API_URL = export const GITEA_API_URL =
process.env.GITEA_API_URL || "https://api.github.com"; process.env.GITEA_API_URL || "https://api.github.com";
// Derive server URL from API URL for Gitea instances
function deriveServerUrl(apiUrl: string): string {
if (apiUrl.includes("api.github.com")) {
return "https://github.com";
}
// For Gitea, remove /api/v1 from the API URL to get the server URL
return apiUrl.replace(/\/api\/v1\/?$/, "");
}
export const GITEA_SERVER_URL = export const GITEA_SERVER_URL =
process.env.GITEA_SERVER_URL || "https://github.com"; process.env.GITEA_SERVER_URL || deriveServerUrl(GITEA_API_URL);