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/components/AdvancedColorPicker.tsx b/components/AdvancedColorPicker.tsx index 1ec62dddc..923e88e5f 100644 --- a/components/AdvancedColorPicker.tsx +++ b/components/AdvancedColorPicker.tsx @@ -205,7 +205,7 @@ export default function AdvancedColorPicker({ }; const handleRgbChange = (channel: 'r' | 'g' | 'b', raw: string) => { - const num = Math.max(0, Math.min(255, parseInt(raw) || 0)); + const num = Math.max(0, Math.min(255, parseInt(raw, 10) || 0)); const current = hexToRgb(value) || { r: 0, g: 0, b: 0 }; const newRgb = { ...current, [channel]: num }; const newHex = rgbToHex(newRgb.r, newRgb.g, newRgb.b); diff --git a/utils/color.ts b/utils/color.ts index 4d8901185..f0259326a 100644 --- a/utils/color.ts +++ b/utils/color.ts @@ -53,7 +53,7 @@ export function rgbToHsl(r: number, g: number, b: number): { h: number; s: numbe break; } } - return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) }; + return { h: Math.round(h * 360 + Number.EPSILON), s: Math.round(s * 100), l: Math.round(l * 100) }; } export function hexToHsl(hex: string): { h: number; s: number; l: number } {