(editor) Improve edges responsiveness

Also fixed a ton of useEffects should make everything a bit more reactive.

Closes #307
This commit is contained in:
Baptiste Arnaud
2023-02-28 15:06:43 +01:00
parent caf4086dd8
commit f8f98adc1c
24 changed files with 438 additions and 429 deletions

View File

@@ -73,7 +73,6 @@ export const Graph = ({
editorContainerRef.current = document.getElementById(
'editor-container'
) as HTMLDivElement
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => {
@@ -84,8 +83,7 @@ export const Graph = ({
y: top + debouncedGraphPosition.y,
scale: debouncedGraphPosition.scale,
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [debouncedGraphPosition])
}, [debouncedGraphPosition, setGlobalGraphPosition])
const handleMouseUp = (e: MouseEvent) => {
if (!typebot) return
@@ -304,5 +302,4 @@ const useAutoMoveBoard = (
return () => {
clearInterval(interval)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [autoMoveDirection])
}, [autoMoveDirection, setGraphPosition])