refactor(props): remove onConnectStop #2299
This commit is contained in:
@@ -160,7 +160,6 @@ export function handleMouseDown({
|
||||
}
|
||||
|
||||
function onMouseUp(event: MouseEvent) {
|
||||
const { onConnectStop, onConnectEnd } = getState();
|
||||
const { connection, isValid } = checkElementBelowIsValid(
|
||||
event,
|
||||
connectionMode,
|
||||
@@ -171,13 +170,11 @@ export function handleMouseDown({
|
||||
doc
|
||||
);
|
||||
|
||||
onConnectStop?.(event);
|
||||
|
||||
if (isValid) {
|
||||
onConnect?.(connection);
|
||||
}
|
||||
|
||||
onConnectEnd?.(event);
|
||||
getState().onConnectEnd?.(event);
|
||||
|
||||
if (elementEdgeUpdaterType && onEdgeUpdateEnd) {
|
||||
onEdgeUpdateEnd(event);
|
||||
|
||||
@@ -74,7 +74,7 @@ const Handle = forwardRef<HTMLDivElement, HandleComponentProps>(
|
||||
};
|
||||
|
||||
const onClick = (event: React.MouseEvent) => {
|
||||
const { onClickConnectStart, onClickConnectStop, onClickConnectEnd, connectionMode } = store.getState();
|
||||
const { onClickConnectStart, onClickConnectEnd, connectionMode } = store.getState();
|
||||
if (!connectionStartHandle) {
|
||||
onClickConnectStart?.(event, { nodeId, handleId, handleType: type });
|
||||
store.setState({ connectionStartHandle: { nodeId, type, handleId } });
|
||||
@@ -92,8 +92,6 @@ const Handle = forwardRef<HTMLDivElement, HandleComponentProps>(
|
||||
doc
|
||||
);
|
||||
|
||||
onClickConnectStop?.(event as unknown as MouseEvent);
|
||||
|
||||
if (isValid) {
|
||||
onConnectExtended(connection);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user