Commit e5ce8325 authored by Michael Vrána's avatar Michael Vrána

Incompatible edges selector fix

parent aa2eea33
Pipeline #80172 passed with stages
in 5 minutes and 28 seconds
......@@ -15,7 +15,6 @@ import { paramNodeRadius } from './ParamNode'
import AlgorithmNode, { emptyNode } from '../../../interfaces/AlgorithmNode'
interface Props {
/**Id of transition from data */
id: string
canvasRef: React.RefObject<SVGSVGElement>
}
......@@ -44,7 +43,7 @@ const edgeSelector = (id: string) => (state: ReduxState) => {
endNode: { ...nodes.get(endNodeId, emptyNode) } as AlgorithmNode,
hasError:
state.algorithmData.present.cycleEdges.contains(id) ||
state.algorithmData.present.incompatibleEdges.contains(edge),
state.algorithmData.present.incompatibleEdges.some(edge => edge.id === id),
cursorMode: state.algorithmCanvas.cursorMode,
positioningNode: state.algorithmCanvas.positioningNode,
mouseDownOffset: state.algorithmCanvas.mouseDownOffset,
......@@ -89,7 +88,6 @@ const EdgeContainer = (props: Props) => {
mouseDownOffset,
gridOn
} = state
// Return if start or end states are missing
if (!startNode || !endNode) return null
......
......@@ -36,7 +36,7 @@ const ParamNodeContainer = (props: ParamNodeContainerProps) => {
ghostEdge: state.algorithmUI.ghostEdge,
buildEdge: state.algorithmCanvas.buildEdge,
hasError: edges.some((edge) =>
state.algorithmData.present.incompatibleEdges.has(edge)
state.algorithmData.present.incompatibleEdges.some(({ id }) => id === edge.id)
),
cursorMode: state.algorithmCanvas.cursorMode
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment