danylokhodus commited on
Commit
29a2ced
·
1 Parent(s): 66c635a

fix: connect subgoal edges to main-target instead of side target handles

Browse files
src/features/canvas/hooks/useCanvasLogic.js CHANGED
@@ -858,9 +858,7 @@ export const useCanvasLogic = (projectId, user) => {
858
  sourceHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
859
  ? 'subgoals-source-left'
860
  : 'subgoals-source-right';
861
- targetHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
862
- ? 'subgoals-target-right'
863
- : 'subgoals-target-left';
864
  } else {
865
  sourceHandle = 'main-source';
866
  // Only use 'main-target' for nodes that actually have that handle ID (task nodes)
@@ -1719,9 +1717,7 @@ export const useCanvasLogic = (projectId, user) => {
1719
  sourceHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
1720
  ? 'subgoals-source-left'
1721
  : 'subgoals-source-right';
1722
- targetHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
1723
- ? 'subgoals-target-right'
1724
- : 'subgoals-target-left';
1725
  } else {
1726
  sourceHandle = 'main-source';
1727
  targetHandle = (targetNode && ['sketch', 'habit', 'condition'].includes(targetNode.type))
 
858
  sourceHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
859
  ? 'subgoals-source-left'
860
  : 'subgoals-source-right';
861
+ targetHandle = 'main-target';
 
 
862
  } else {
863
  sourceHandle = 'main-source';
864
  // Only use 'main-target' for nodes that actually have that handle ID (task nodes)
 
1717
  sourceHandle = (e.condition === 'SubgoalLeft' || e.condition === 'subgoals-source-left')
1718
  ? 'subgoals-source-left'
1719
  : 'subgoals-source-right';
1720
+ targetHandle = 'main-target';
 
 
1721
  } else {
1722
  sourceHandle = 'main-source';
1723
  targetHandle = (targetNode && ['sketch', 'habit', 'condition'].includes(targetNode.type))