fix: incorrect phase reduction order
This commit is contained in:
committed by
Pim Hutting
parent
9c80391fea
commit
9b3414ba98
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
Handle,
|
||||
useNodeConnections,
|
||||
type HandleType,
|
||||
type Position
|
||||
} from '@xyflow/react';
|
||||
|
||||
|
||||
const LimitedConnectionCountHandle = (props: {
|
||||
node_id: string,
|
||||
type: HandleType,
|
||||
position: Position,
|
||||
connection_count: number,
|
||||
id?: string
|
||||
}) => {
|
||||
const connections = useNodeConnections({
|
||||
id: props.node_id,
|
||||
handleType: props.type,
|
||||
handleId: props.id,
|
||||
});
|
||||
|
||||
return (
|
||||
<Handle
|
||||
{...props}
|
||||
isConnectable={connections.length < props.connection_count}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default LimitedConnectionCountHandle;
|
||||
Reference in New Issue
Block a user