fix: fix npm build (#43)

This commit is contained in:
Abhishek 2025-11-06 22:28:16 +05:30 committed by GitHub
parent 1a0a18a435
commit 8d05c9f890
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -283,7 +283,7 @@ function RenderWorkflow({ initialWorkflowName, workflowId, initialFlow, initialT
<Button
variant="outline"
size="icon"
onClick={() => setNodes(layoutNodes(nodes, edges, 'LR', rfInstance, saveWorkflow))}
onClick={() => setNodes(layoutNodes(nodes, edges, 'LR', rfInstance))}
className="bg-white shadow-sm hover:shadow-md h-8 w-8"
>
<BrushCleaning className="h-4 w-4" />

View file

@ -6,6 +6,7 @@ import {
OnNodesChange,
ReactFlowInstance,
} from "@xyflow/react";
import { EdgeChange, NodeChange } from "@xyflow/system";
import { useRouter } from "next/navigation";
import { useCallback, useEffect, useRef } from "react";
@ -317,7 +318,9 @@ export const useWorkflowState = ({
(changes) => {
const currentEdges = useWorkflowStore.getState().edges;
const newEdges = applyEdgeChanges(changes, currentEdges) as FlowEdge[];
setEdges(newEdges, changes);
// Cast changes to FlowEdge type - safe because setEdges only uses the type field
// to determine history tracking, not the actual item data
setEdges(newEdges, changes as EdgeChange<FlowEdge>[]);
},
[setEdges],
);
@ -326,7 +329,9 @@ export const useWorkflowState = ({
(changes) => {
const currentNodes = useWorkflowStore.getState().nodes;
const newNodes = applyNodeChanges(changes, currentNodes) as FlowNode[];
setNodes(newNodes, changes);
// Cast changes to FlowNode type - safe because setNodes only uses the type field
// to determine history tracking, not the actual item data
setNodes(newNodes, changes as NodeChange<FlowNode>[]);
},
[setNodes],
);