Fixed multiple set pending on move making it lag
This commit is contained in:
parent
081b6a63be
commit
c28817ed3b
1 changed files with 3 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ export default function Page({
|
|||
const reactFlowWrapper = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { takeSnapshot } = useContext(undoRedoContext);
|
||||
const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange, setPending, saveFlow } = useContext(FlowsContext);
|
||||
const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange, setPending, saveFlow, isPending } = useContext(FlowsContext);
|
||||
|
||||
const position = useRef({ x: 0, y: 0 });
|
||||
const [lastSelection, setLastSelection] =
|
||||
|
|
@ -370,7 +370,8 @@ export default function Page({
|
|||
}, []);
|
||||
|
||||
const onMove = useCallback(() => {
|
||||
setPending(true);
|
||||
if(!isPending)
|
||||
setPending(true);
|
||||
}, [setPending]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue