chore(edge-toolbar): cleanup

This commit is contained in:
moklick
2025-10-20 12:50:41 +02:00
parent cb22c4541b
commit 391d6f04ea
@@ -50,11 +50,11 @@ export function EdgeToolbar({
const isActive = typeof isVisible === 'boolean' ? isVisible : edge?.selected; const isActive = typeof isVisible === 'boolean' ? isVisible : edge?.selected;
const zoom = useStore(zoomSelector); const zoom = useStore(zoomSelector);
if (!isActive || !edge) { if (!isActive) {
return null; return null;
} }
const zIndex = (edge.zIndex ?? 0) + 1; const zIndex = (edge?.zIndex ?? 0) + 1;
const transform = getEdgeToolbarTransform(x, y, zoom, alignX, alignY); const transform = getEdgeToolbarTransform(x, y, zoom, alignX, alignY);
return ( return (
@@ -69,7 +69,7 @@ export function EdgeToolbar({
...style, ...style,
}} }}
className={cc(['react-flow__edge-toolbar', className])} className={cc(['react-flow__edge-toolbar', className])}
data-id={edge.id} data-id={edge?.id ?? ''}
{...rest} {...rest}
> >
{children} {children}