Dragging down a downstream node of a Switch operator will cause the end_cpn_ids to contain the ID of the placeholder operator. #12177 (#12178)

### What problem does this PR solve?

Dragging down a downstream node of a Switch operator will cause the
end_cpn_ids to contain the ID of the placeholder operator. #12177

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-12-24 19:45:35 +08:00
committed by GitHub
parent 667dc5467e
commit 906f19e863

View File

@ -466,7 +466,7 @@ const useGraphStore = create<RFState>()(
}
},
updateSwitchFormData: (source, sourceHandle, target, isConnecting) => {
const { updateNodeForm, edges } = get();
const { updateNodeForm, edges, getOperatorTypeFromId } = get();
if (sourceHandle) {
// A handle will connect to multiple downstream nodes
let currentHandleTargets = edges
@ -474,7 +474,8 @@ const useGraphStore = create<RFState>()(
(x) =>
x.source === source &&
x.sourceHandle === sourceHandle &&
typeof x.target === 'string',
typeof x.target === 'string' &&
getOperatorTypeFromId(x.target) !== Operator.Placeholder,
)
.map((x) => x.target);