From 7ea42125056e5362e73007e57fd348373d76cfb6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:07:34 +0000 Subject: [PATCH 1/2] Fix: Prevent race condition when opening dialogs from toolbar The race condition occurred when an unauthenticated user clicked the toolbar to open a dialog. The `pointerup` event would toggle the dialog open, but then bubble up to a document-level listener that would immediately close it. This fix calls `event.stopPropagation()` in the toolbar's `onPointerUp` handler to prevent the event from reaching the document listener, ensuring the dialog remains open as intended. --- src/Board/Toolbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Board/Toolbar.tsx b/src/Board/Toolbar.tsx index 0cad6f18..9f40fee7 100644 --- a/src/Board/Toolbar.tsx +++ b/src/Board/Toolbar.tsx @@ -13,7 +13,7 @@ export default function Toolbar({ friendData }: ToolbarProps) { const friendDataValue = friendData?.val(); return ( -
toggle('friends')}> +
{ toggle('friends'); e.stopPropagation(); }}> {friendDataValue ? : account_circle} From 415e8617750c77357045f6b289e07e8c2b774097 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:22:49 +0000 Subject: [PATCH 2/2] Fix: Prevent race condition when opening dialogs from toolbar The race condition occurred when an unauthenticated user clicked the toolbar to open a dialog. The `pointerup` event would toggle the dialog open, but then bubble up to a document-level listener that would immediately close it. This fix calls `event.stopPropagation()` in the toolbar's `onPointerUp` handler to prevent the event from reaching the document listener, ensuring the dialog remains open as intended.