From 230feb3fd91e4fe9810696b506b9bdaa2c400a4c Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 16:23:41 +0530 Subject: [PATCH] fix: resolve 4 bugs in commitpulse --- app/api/streak/live/ws/route.ts | 2 +- app/generator/components/GitHubImportModal.tsx | 2 ++ utils/time.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/streak/live/ws/route.ts b/app/api/streak/live/ws/route.ts index 62e28b129..bdd4e2949 100644 --- a/app/api/streak/live/ws/route.ts +++ b/app/api/streak/live/ws/route.ts @@ -26,7 +26,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/app/generator/components/GitHubImportModal.tsx b/app/generator/components/GitHubImportModal.tsx index ec58bc087..8d8ea9fb7 100644 --- a/app/generator/components/GitHubImportModal.tsx +++ b/app/generator/components/GitHubImportModal.tsx @@ -284,3 +284,5 @@ export function GitHubImportModal({ isOpen, onClose, onApply }: GitHubImportModa ); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/utils/time.ts b/utils/time.ts index 8a31fa765..4d42c7a85 100644 --- a/utils/time.ts +++ b/utils/time.ts @@ -53,7 +53,7 @@ export function getSecondsUntilMidnightInTimezone(tz?: string | null): number { hourCycle: 'h23', }).formatToParts(now); - const get = (type: string) => parseInt(parts.find((p) => p.type === type)?.value ?? '0', 10); + const get = (type: string) => parseInt(parts.find((p, 10) => p.type === type)?.value ?? '0', 10); // hour24 can return 24 at midnight in some Intl implementations; normalise with % 24 const hour = get('hour') % 24;