From 2906f31502c7eab41104169b960ba1e78e0a487a Mon Sep 17 00:00:00 2001 From: lorentz Date: Sat, 18 Jul 2026 13:10:42 +0000 Subject: [PATCH] fix(tasks): keep generate confirmation dialog open during in-flight request AlertDialogAction closes the dialog synchronously on click before any awaited handler logic runs, so the disabled/'Generating...' state on the Confirm button was unreachable. Call event.preventDefault() in handleConfirmGenerate to suppress Radix's auto-close; the dialog now closes explicitly via setPreview(null) only on success, and stays open (with the toast) on error so the user can retry or cancel. --- ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx index 78eea06..2c065a5 100644 --- a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx +++ b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx @@ -194,7 +194,8 @@ export function BulkAssignClient({ users, clients, designations }: BulkAssignCli } } - const handleConfirmGenerate = async () => { + const handleConfirmGenerate = async (event: React.MouseEvent) => { + event.preventDefault() setGenerating(true) try { const res = await fetch('/api/tasks/generate-and-assign', {