Skip to content

Commit

Permalink
fix: update condition to unlock when stepByStep pauses
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusThielker committed Aug 2, 2023
1 parent 48a4f18 commit 3e7c4ff
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/editor/pages/canvas/DragAndDropFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export default function DragAndDropFlow() {
const [lastEventPosition, setLastEventPosition] = useState<{x: number, y: number}>({x: 0, y: 0})

const isProcessRunning = usePlayStore(state => state.isProcessRunning)
const isStepByStep = usePlayStore(state => state.isStepByStep)
const isNextStepReady = usePlayStore(state => state.isNextStepReady)

const onDragOver = useCallback((event: any) => {
event.preventDefault();
Expand Down Expand Up @@ -142,12 +144,12 @@ export default function DragAndDropFlow() {
}}
deleteKeyCode={["Backspace", "Delete"]}
onSelectionChange={setSelectedNodes}
edgesUpdatable={!isProcessRunning}
edgesFocusable={!isProcessRunning}
nodesDraggable={!isProcessRunning}
nodesConnectable={!isProcessRunning}
nodesFocusable={!isProcessRunning}
elementsSelectable={!isProcessRunning}
edgesUpdatable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
edgesFocusable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
nodesDraggable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
nodesConnectable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
nodesFocusable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
elementsSelectable={isProcessRunning ? (isStepByStep ? isNextStepReady : false) : true}
>
<Controls />
<Background variant={BackgroundVariant.Dots} />
Expand Down

0 comments on commit 3e7c4ff

Please sign in to comment.