From 59c41ee8f71d95ca4bac103c8bf1459258a07de6 Mon Sep 17 00:00:00 2001 From: Thomas Joise Date: Fri, 17 Jul 2026 13:30:30 +0530 Subject: [PATCH] fix(hq-web): guard client dialog against double-submit and cancel-during-save Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/hq-web/src/components/ClientFormDialog.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/hq-web/src/components/ClientFormDialog.tsx b/apps/hq-web/src/components/ClientFormDialog.tsx index 663a5d4..525f57d 100644 --- a/apps/hq-web/src/components/ClientFormDialog.tsx +++ b/apps/hq-web/src/components/ClientFormDialog.tsx @@ -38,6 +38,7 @@ export function ClientFormDialog(props: { setContacts((prev) => prev.map((c, j) => (j === i ? { ...c, [k]: e.target.value } : c))) const save = () => { + if (saving) return if (f.name.trim() === '') { setError('Name is required'); return } if (!/^\d{2}$/.test(f.stateCode.trim())) { setError('State code must be two digits'); return } const cleaned: ClientContact[] = contacts @@ -72,12 +73,12 @@ export function ClientFormDialog(props: { return ( { if (!saving) props.onClose() }} title={editing ? `Edit ${props.initial!.name}` : 'New client'} size="lg" footer={ <> - + }