Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

fixing #372: transitions makred as potentials even though ... #328

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions src/TransitionViz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@ export const TransitionViz: React.FC<{
return null;
}

// extra check if the transition might be blocked by the 'in' property...
const isBlocked = !!definition.in && !state.matches(definition.in);
jbouecke marked this conversation as resolved.
Show resolved Hide resolved

const isDisabled =
delay?.delayType === 'DELAYED_INVALID' ||
!state.nextEvents.includes(definition.eventType);

const isPotential =
state.nextEvents.includes(edge.transition.eventType) &&
!!state.configuration.find((sn) => sn === edge.source);
state.nextEvents.includes(definition.eventType) &&
!!state.configuration.find((sn) => sn === edge.source) &&
!isBlocked;

return (
<button
Expand Down