feat: Add Gitea configuration hook and enhance repository list with Gitea links

This commit is contained in:
Arunavo Ray
2025-05-24 15:18:31 +05:30
parent a988be1028
commit cbef04d4b4
4 changed files with 240 additions and 61 deletions

View File

@@ -145,3 +145,10 @@ export function useConfigStatus(): ConfigStatus {
export function invalidateConfigCache() {
configCache = { data: null, timestamp: 0, userId: null };
}
// Export function to get cached config data for other hooks
export function getCachedConfig(): ConfigApiResponse | null {
const now = Date.now();
const isCacheValid = configCache.data && (now - configCache.timestamp) < CACHE_DURATION;
return isCacheValid ? configCache.data : null;
}