From 5cfa8748d548c81d38eb1aa4daaecabc93ac3e0c Mon Sep 17 00:00:00 2001 From: aaldebs99 Date: Fri, 12 Dec 2025 02:19:42 +0000 Subject: [PATCH] fix(frontend): race condition in label create dialog --- frontend/src/components/Labels/LabelCreateDialog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Labels/LabelCreateDialog.tsx b/frontend/src/components/Labels/LabelCreateDialog.tsx index e7e0466..67b8a29 100644 --- a/frontend/src/components/Labels/LabelCreateDialog.tsx +++ b/frontend/src/components/Labels/LabelCreateDialog.tsx @@ -130,7 +130,9 @@ const LabelCreateDialog: React.FC = ({ background_color: formData.background_color || undefined, icon: formData.icon || undefined, }); - handleClose(); + // Call onClose directly after successful submission + // Don't use handleClose() here to avoid race conditions with loading state + onClose(); } catch (error) { console.error('Failed to save label:', error); // Could add error handling UI here