Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/main/frontend/app/routes/studio/canvas/flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
logApiError('Failed to save XML', error as Error)
setIdle()
}
}, [])

Check warning on line 341 in src/main/frontend/app/routes/studio/canvas/flow.tsx

View workflow job for this annotation

GitHub Actions / Build & Run All Tests

React Hook useCallback has missing dependencies: 'setIdle', 'setSaved', and 'setSaving'. Either include them or remove the dependency array

const autosaveEnabled = useSettingsStore((s) => s.general.autoSave.enabled)
const autosaveDelay = useSettingsStore((s) => s.general.autoSave.delayMs)
Expand Down Expand Up @@ -691,7 +691,7 @@
node.type === 'frankNode' || node.type === 'exitNode' ? { ...node, position: { x: 0, y: 0 } } : node,
)
const laidOutNodes = layoutGraph(nodesWithResetPositions, flowStore.edges, 'LR')
flowStore.setNodes(laidOutNodes)
flowStore.setNodesWithoutHistory(laidOutNodes)

if (pendingSelection) {
applySelectionToNodes(pendingSelection)
Expand All @@ -702,6 +702,9 @@
reactFlowRef.current?.setViewport(freshViewport)
})
}

flowStore.setHistory([])
flowStore.setFuture([])
}, [
nodesInitialized,
relayoutNonce,
Expand Down Expand Up @@ -1220,7 +1223,7 @@
setParentId(null)
}

function addNodeAtPosition(

Check warning on line 1226 in src/main/frontend/app/routes/studio/canvas/flow.tsx

View workflow job for this annotation

GitHub Actions / Build & Run All Tests

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed
position: { x: number; y: number },
elementName: string,
sourceInfo?: { nodeId: string | null; handleId: string | null; handleType: 'source' | 'target' | null },
Expand Down
Loading