From e2cdefb30c46f9baaa83bbb7cf5176dfe636e84e Mon Sep 17 00:00:00 2001 From: David Khourshid Date: Wed, 2 Aug 2023 23:47:56 -0400 Subject: [PATCH 1/3] Fix ActionViz --- src/ActionViz.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ActionViz.tsx b/src/ActionViz.tsx index bc61bd69..679728b7 100644 --- a/src/ActionViz.tsx +++ b/src/ActionViz.tsx @@ -62,11 +62,16 @@ export const ActionType: React.FC<{ title?: string }> = ({ }; export const RaiseActionLabel: React.FC<{ - action: PotentiallyStructurallyCloned>; + action: PotentiallyStructurallyCloned>; }> = ({ action }) => { + const eventType = + typeof action.event === 'object' && action.event !== null + ? action.event.type ?? unknown + : `${action.event}`; + return ( - raise {action.event} + raise {eventType} ); }; From 56215518bce855260cf6c0a76c1fc5c851b71f60 Mon Sep 17 00:00:00 2001 From: David Khourshid Date: Wed, 2 Aug 2023 23:50:44 -0400 Subject: [PATCH 2/3] Add changeset --- .changeset/fast-taxis-smash.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fast-taxis-smash.md diff --git a/.changeset/fast-taxis-smash.md b/.changeset/fast-taxis-smash.md new file mode 100644 index 00000000..9d332261 --- /dev/null +++ b/.changeset/fast-taxis-smash.md @@ -0,0 +1,5 @@ +--- +'xstate-viz-app': patch +--- + +Fixes issue where raise actions were causing visualizer to crash From 39290c17e9d216931ce039d3e031a4a3112bccd9 Mon Sep 17 00:00:00 2001 From: David Khourshid Date: Wed, 2 Aug 2023 23:52:22 -0400 Subject: [PATCH 3/3] Lint --- src/ActionViz.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ActionViz.tsx b/src/ActionViz.tsx index 679728b7..c5b47367 100644 --- a/src/ActionViz.tsx +++ b/src/ActionViz.tsx @@ -62,7 +62,7 @@ export const ActionType: React.FC<{ title?: string }> = ({ }; export const RaiseActionLabel: React.FC<{ - action: PotentiallyStructurallyCloned>; + action: PotentiallyStructurallyCloned>; }> = ({ action }) => { const eventType = typeof action.event === 'object' && action.event !== null