Skip to content

Commit

Permalink
fix missing edge
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie2111 committed Sep 23, 2024
1 parent 60ffbd1 commit 17a0d2e
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/modules/blockchains/Buy/hooks/useNodeHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const useNodeHelper = () => {
const isHandleExists = edges.some(
(handle) => handle.sourceHandle === `${rootNode}-s-${suffix}`,
);
let nodesData = nodes;
let nodesData = newState.nodes;

if (!isHandleExists) {
getHandleNodeBlockChain?.data?.sourceHandles?.push(
Expand Down Expand Up @@ -83,13 +83,6 @@ const useNodeHelper = () => {
});
}

console.log('[useNodeHelper] addDappToNode', {
dappIndex,
position,
thisDapp,
ids,
});

const newNode: DappNode = {
id: newNodeId,
type: dappKeyToNodeKey(thisDapp.key),
Expand Down Expand Up @@ -141,15 +134,10 @@ const useNodeHelper = () => {
draggedIds2DSignal.value = [...draggedIds2DSignal.value, ids];

setDraggedIds2D([...draggedIds2DSignal.value]);
setNodes([...newState.nodes, newNode]);
setNodes([...nodesData, newNode]);
setEdges([...newState.edges, newEdge]);
setNewState({
nodes: [...newState.nodes, newNode],
edges: [...newState.edges, newEdge],
});

console.log('[useNodeHelper] addDappToNode', {
nodes: [...newState.nodes, newNode],
nodes: [...nodesData, newNode],
edges: [...newState.edges, newEdge],
});

Expand Down

0 comments on commit 17a0d2e

Please sign in to comment.