From 71ff3d8435c2c7d0936d3c765d6af1430562d349 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 05:49:02 +0530 Subject: [PATCH] fix: resolve 4 bugs in commitpulse --- app/api/reviews/route.ts | 2 ++ app/api/streak/live/route.ts | 2 +- context/TranslationContext.tsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/reviews/route.ts b/app/api/reviews/route.ts index 51c6f2779..cfae4c478 100644 --- a/app/api/reviews/route.ts +++ b/app/api/reviews/route.ts @@ -185,3 +185,5 @@ export async function POST(req: Request) { ); } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/app/api/streak/live/route.ts b/app/api/streak/live/route.ts index b7745f720..1f979fb8d 100644 --- a/app/api/streak/live/route.ts +++ b/app/api/streak/live/route.ts @@ -16,7 +16,7 @@ export async function GET(request: Request) { let interval = 30; // default 30s if (intervalParam) { const parsed = parseInt(intervalParam, 10); - if (!isNaN(parsed)) { + if (!Number.isNaN(parsed)) { interval = Math.max(30, Math.min(parsed, 300)); } } diff --git a/context/TranslationContext.tsx b/context/TranslationContext.tsx index d23d9549f..5dfaadf39 100644 --- a/context/TranslationContext.tsx +++ b/context/TranslationContext.tsx @@ -59,7 +59,7 @@ const getNestedValue = ( obj: Record | null | undefined, path: string ): string | undefined => { - if (!obj) return undefined; + if (!obj) return; const parts = path.split('.'); let current: unknown = obj; for (const part of parts) {