added final connection state to onReconnectEnd

This commit is contained in:
peterkogo
2024-08-15 12:52:40 +02:00
parent 51f8f56566
commit 8590f9dfea
5 changed files with 21 additions and 12 deletions
+4 -3
View File
@@ -194,13 +194,14 @@ function onPointerDown(
// in order to get the latest state of onConnectEnd
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { inProgress, ...connectionState } = previousConnection;
onConnectEnd?.(event, {
const finalConnectionState = {
...connectionState,
toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,
});
};
onConnectEnd?.(event, finalConnectionState);
if (edgeUpdaterType) {
onReconnectEnd?.(event);
onReconnectEnd?.(event, finalConnectionState);
}
cancelConnection();