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.
This commit is contained in:
parent
b8ea94e37b
commit
2906f31502
1 changed files with 2 additions and 1 deletions
|
|
@ -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', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue