Skip to content

Commit 25b823c

Browse files
authored
Merge pull request #89 from HazarBakir/main
refactor: update github, api client
2 parents 197a247 + 1d95daf commit 25b823c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/api/github-api-client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class GitHubAPIClient {
108108
private githubToken = "";
109109

110110
constructor() {
111+
111112
// Only read env token on the server to avoid exposing secrets client-side
112113
if (
113114
typeof window === "undefined" &&
@@ -184,6 +185,7 @@ class GitHubAPIClient {
184185
getTokenInfo(): { hasToken: boolean; tokenPrefix: string; source: string } {
185186
return {
186187
hasToken: !!this.githubToken,
188+
187189
tokenPrefix: this.githubToken
188190
? this.githubToken.substring(0, 10) + "..."
189191
: "NO_TOKEN",
@@ -284,6 +286,7 @@ class GitHubAPIClient {
284286

285287
const data = await response.json();
286288

289+
287290
// Update rate limit display if running in browser
288291
if (typeof window !== "undefined") {
289292
const updateRateLimit = (
@@ -315,6 +318,7 @@ class GitHubAPIClient {
315318
}
316319
}
317320

321+
318322
this.cache.set(cacheKey, { data, timestamp: Date.now() });
319323
return data;
320324
} catch (error) {

0 commit comments

Comments
 (0)