Skip to content

Commit

Permalink
fix variable
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Mar 18, 2024
1 parent 624ae98 commit fa39470
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CameraControls/useCenterGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const useCenterGraph = ({
const mounted = useRef<boolean>(false);

const centerNodes = useCallback(
async (centerNodes: InternalGraphNode[], animated = true) => {
async (centerNodes: InternalGraphNode[], shouldAnimate = true) => {
if (
centerNodes?.some(node => !isNodeInView(camera, node.position)) ||
!mounted.current
Expand All @@ -86,7 +86,7 @@ export const useCenterGraph = ({
new Vector3(minX, minY, minZ),
new Vector3(maxX, maxY, maxZ)
),
animated,
shouldAnimate,
{
cover: false,
paddingLeft: PADDING,
Expand All @@ -95,7 +95,7 @@ export const useCenterGraph = ({
paddingTop: PADDING
}
);
await controls.setTarget(x, y, z, animated);
await controls.setTarget(x, y, z, shouldAnimate);

if (!isCentered) {
setIsCentered(true);
Expand All @@ -105,7 +105,7 @@ export const useCenterGraph = ({
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[invalidate, controls, animated, nodes]
[invalidate, controls, nodes]
);

const centerNodesById = useCallback(
Expand Down

0 comments on commit fa39470

Please sign in to comment.