2
0

perf(editor): ️ Improve graph transition perf

This commit is contained in:
Baptiste Arnaud
2022-02-14 18:56:29 +01:00
parent e7d1f5d674
commit 714f7c8ce5
9 changed files with 61 additions and 42 deletions

View File

@ -24,7 +24,7 @@ export const DropOffEdge = ({
onUnlockProPlanClick,
}: Props) => {
const { user } = useUser()
const { sourceEndpoints, graphPosition, blocksCoordinates } = useGraph()
const { sourceEndpoints, blocksCoordinates, graphOffsetY } = useGraph()
const { publishedTypebot } = useTypebot()
const isUserOnFreePlan = isFreePlan(user)
@ -59,13 +59,12 @@ export const DropOffEdge = ({
const sourceTop = useMemo(
() =>
getEndpointTopOffset(
graphPosition,
sourceEndpoints,
block?.steps[block.steps.length - 1].id,
true
graphOffsetY,
block?.steps[block.steps.length - 1].id
),
// eslint-disable-next-line react-hooks/exhaustive-deps
[block?.steps, graphPosition, sourceEndpoints, blocksCoordinates]
[block?.steps, sourceEndpoints, blocksCoordinates]
)
const labelCoordinates = useMemo(() => {