From f2bd45c68ebfc2db77e8faf288859e257efc954a Mon Sep 17 00:00:00 2001 From: Grace Date: Wed, 1 Apr 2026 13:27:03 +0100 Subject: [PATCH] Don't allow Button B recording if dialogs are opened For example, if the training dialog is opened. --- src/components/DataSamplesTable.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/DataSamplesTable.tsx b/src/components/DataSamplesTable.tsx index 4b8a77923..aa7ea572e 100644 --- a/src/components/DataSamplesTable.tsx +++ b/src/components/DataSamplesTable.tsx @@ -82,6 +82,9 @@ const DataSamplesTable = ({ const connection = useConnectActions(); const { isConnected } = useConnectionStage(); + const isNonConnectionDialogOpen = useStore( + (s) => s.isNonConnectionDialogOpen + ); // For adding flashing animation for new recording. const [newRecordingId, setNewRecordingId] = useState( @@ -90,12 +93,11 @@ const DataSamplesTable = ({ useEffect(() => { const listener = (e: ButtonEvent) => { - // Allow Button B recording when tour is not in progress and the + // Allow Button B recording when no dialogs are opened and the // record button for selected action is displayed. if ( - !isRecordingDialogOpen && + !isNonConnectionDialogOpen() && e.state && - tourState === undefined && (selectedAction.name.length > 0 || selectedAction.recordings.length > 0) ) { setRecordingOptions({ @@ -111,7 +113,7 @@ const DataSamplesTable = ({ }; }, [ connection, - isRecordingDialogOpen, + isNonConnectionDialogOpen, recordingDialogOnOpen, selectedAction, tourState,