chore(edge-toolbar): cleanup
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user