From 8f99b84fa4ff19ca97f1eb94fc432e716e9bced6 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sat, 8 Aug 2026 14:50:40 +0530 Subject: [PATCH] fix: resolve 4 bugs in Draftdeckai --- app/api/stripe/create-payment-intent/route.ts | 2 +- components/credits-display.tsx | 2 ++ components/dashboard/history-dashboard.tsx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/stripe/create-payment-intent/route.ts b/app/api/stripe/create-payment-intent/route.ts index 74c723f5..0e08a769 100644 --- a/app/api/stripe/create-payment-intent/route.ts +++ b/app/api/stripe/create-payment-intent/route.ts @@ -28,7 +28,7 @@ export async function POST(request: Request) { const { amount, currency = 'usd', metadata = {} } = await request.json() as RequestData; - if (!amount || isNaN(amount)) { + if (!amount || Number.isNaN(amount)) { return new Response(JSON.stringify({ error: 'Invalid amount' }), { status: 400, headers: { diff --git a/components/credits-display.tsx b/components/credits-display.tsx index 6f49a26d..67567bac 100644 --- a/components/credits-display.tsx +++ b/components/credits-display.tsx @@ -282,3 +282,5 @@ export function CreditsDisplay() { ); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/components/dashboard/history-dashboard.tsx b/components/dashboard/history-dashboard.tsx index fcef7c28..9ec8f1d3 100644 --- a/components/dashboard/history-dashboard.tsx +++ b/components/dashboard/history-dashboard.tsx @@ -981,3 +981,5 @@ export function HistoryDashboard() { ); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file