chore(analytics): ♿️ Disable edge delete
This commit is contained in:
@@ -26,6 +26,7 @@ export const Edge = ({ edge }: { edge: EdgeProps }) => {
|
|||||||
targetEndpoints,
|
targetEndpoints,
|
||||||
blocksCoordinates,
|
blocksCoordinates,
|
||||||
graphPosition,
|
graphPosition,
|
||||||
|
isReadOnly,
|
||||||
} = useGraph()
|
} = useGraph()
|
||||||
const [isMouseOver, setIsMouseOver] = useState(false)
|
const [isMouseOver, setIsMouseOver] = useState(false)
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
const { isOpen, onOpen, onClose } = useDisclosure()
|
||||||
@@ -87,6 +88,7 @@ export const Edge = ({ edge }: { edge: EdgeProps }) => {
|
|||||||
const handleMouseLeave = () => setIsMouseOver(false)
|
const handleMouseLeave = () => setIsMouseOver(false)
|
||||||
|
|
||||||
const handleEdgeClick = (e: React.MouseEvent) => {
|
const handleEdgeClick = (e: React.MouseEvent) => {
|
||||||
|
if (isReadOnly) return
|
||||||
setEdgeMenuPosition({ x: e.clientX, y: e.clientY })
|
setEdgeMenuPosition({ x: e.clientX, y: e.clientY })
|
||||||
onOpen()
|
onOpen()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user