Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/components/DataSamplesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | undefined>(
Expand All @@ -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({
Comment on lines +99 to 101
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tour state check is included in isNonConnectionDialogOpen (see here)

Expand All @@ -111,7 +113,7 @@ const DataSamplesTable = ({
};
}, [
connection,
isRecordingDialogOpen,
isNonConnectionDialogOpen,
recordingDialogOnOpen,
selectedAction,
tourState,
Expand Down
Loading