refactor(store): cleanup
This commit is contained in:
@@ -100,7 +100,7 @@ const StoreUpdater = ({
|
||||
return () => {
|
||||
reset();
|
||||
};
|
||||
}, [reset]);
|
||||
}, []);
|
||||
|
||||
useStoreUpdater<Node[]>(nodes, setNodes);
|
||||
useStoreUpdater<Edge[]>(edges, setEdges);
|
||||
|
||||
+1
-3
@@ -80,9 +80,7 @@ const createStore = () =>
|
||||
|
||||
nodeInternals.forEach((node) => {
|
||||
if (node.selected) {
|
||||
if (!node.parentNode) {
|
||||
changes.push(createPositionChange({ node, diff, dragging, nodeExtent, nodeInternals }));
|
||||
} else if (!isParentSelected(node, nodeInternals)) {
|
||||
if (!node.parentNode || !isParentSelected(node, nodeInternals)) {
|
||||
changes.push(createPositionChange({ node, diff, dragging, nodeExtent, nodeInternals }));
|
||||
}
|
||||
} else if (node.id === id) {
|
||||
|
||||
Reference in New Issue
Block a user