refactor(core): find handle by id regardless of num of handles

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent 0941e609dd
commit 84c2f6df99
+1 -7
View File
@@ -37,13 +37,7 @@ export function getHandle(bounds: HandleElement[] = [], handleId?: string | null
return null
}
if (!handleId || bounds.length === 1) {
return bounds[0]
} else if (handleId) {
return bounds.find((d) => d.id === handleId) || null
}
return null
return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null
}
export function getEdgePositions(