hard code the repo name and repo owner

This commit is contained in:
CREDO23 2025-10-19 23:27:14 +02:00
parent 14dd57815e
commit 9af7ea51f6

View file

@ -3,9 +3,6 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
export const useGithubStars = () => { export const useGithubStars = () => {
const repo = process.env.NEXT_PUBLIC_GITHUB_REPO;
const owner = process.env.NEXT_PUBLIC_GITHUB_OWNER;
const [stars, setStars] = useState<number | null>(null); const [stars, setStars] = useState<number | null>(null);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
@ -14,13 +11,9 @@ export const useGithubStars = () => {
const abortController = new AbortController(); const abortController = new AbortController();
const getStars = async () => { const getStars = async () => {
try { try {
if (!repo || !owner) {
throw new Error("Missing GitHub credentials");
}
setError(null); setError(null);
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`, { const response = await fetch(`https://api.github.com/repos/MODSetter/SurfSense`, {
signal: abortController.signal, signal: abortController.signal,
}); });
@ -46,7 +39,7 @@ export const useGithubStars = () => {
return () => { return () => {
abortController.abort(); abortController.abort();
}; };
}, [repo, owner]); }, []);
return { return {
stars, stars,