chore(connction-handler): cleanup

This commit is contained in:
moklick
2023-02-06 02:00:35 +01:00
parent 383a074aea
commit 230106da73
@@ -154,11 +154,9 @@ export function handlePointerDown({
} }
function onPointerUp(event: MouseEvent | TouchEvent) { function onPointerUp(event: MouseEvent | TouchEvent) {
if (prevClosestHandle) { if (prevClosestHandle && connection && isValid) {
if (connection && isValid) {
onConnect?.(connection); onConnect?.(connection);
} }
}
// it's important to get a fresh reference from the store here // it's important to get a fresh reference from the store here
// in order to get the latest state of onConnectEnd // in order to get the latest state of onConnectEnd