fix arrow connection

This commit is contained in:
cristhianzl 2024-01-31 17:44:36 -03:00
commit f8dd179d97

View file

@ -316,10 +316,11 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
(node) => node.id === connection.source || node.id === connection.target (node) => node.id === connection.source || node.id === connection.target
); );
const sourceType = findNode?.data?.type; const sourceType = findNode?.data?.type;
let isIo = false; let isIoIn = false;
let isIoOut = false;
if (sourceType) { if (sourceType) {
isIo = inputTypes.has(sourceType); isIoIn = inputTypes.has(sourceType);
isIo = outputTypes.has(sourceType); isIoOut = outputTypes.has(sourceType);
} }
let newEdges: Edge[] = []; let newEdges: Edge[] = [];
@ -340,8 +341,8 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
animated: animated:
(scapeJSONParse(connection.targetHandle!) as targetHandleType) (scapeJSONParse(connection.targetHandle!) as targetHandleType)
.type === "Text", .type === "Text",
markerEnd: isIo ? { ...commonMarkerProps } : undefined, markerEnd: isIoIn || isIoOut ? { ...commonMarkerProps } : undefined,
markerStart: isIo ? { ...commonMarkerProps } : undefined, markerStart: isIoIn || isIoOut ? { ...commonMarkerProps } : undefined,
}, },
oldEdges oldEdges
); );