fix:
- react-hooks/exhaustive-deps added - style update - key fix
This commit is contained in:
@@ -64,6 +64,7 @@ function MoveControls3D({ boundingBoxRef }: any) {
|
||||
setContextAction(null);
|
||||
moveAssets()
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [contextAction])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -176,6 +177,7 @@ function MoveControls3D({ boundingBoxRef }: any) {
|
||||
canvasElement.removeEventListener("keydown", onKeyDown);
|
||||
canvasElement?.removeEventListener("keyup", onKeyUp);
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [camera, controls, scene, toggleView, selectedAssets, socket, pastedObjects, duplicatedObjects, movedObjects, rotatedObjects, keyEvent, initialStates]);
|
||||
|
||||
const calculateDragOffset = useCallback((point: THREE.Object3D, hitPoint: THREE.Vector3) => {
|
||||
@@ -223,6 +225,7 @@ function MoveControls3D({ boundingBoxRef }: any) {
|
||||
setDragOffset(newOffset);
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [axisConstraint, camera, movedObjects])
|
||||
|
||||
useFrame(() => {
|
||||
|
||||
@@ -67,6 +67,7 @@ const SelectionControls3D: React.FC = () => {
|
||||
setContextAction(null);
|
||||
deleteSelection()
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [contextAction])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -222,12 +223,14 @@ const SelectionControls3D: React.FC = () => {
|
||||
helper.enabled = false;
|
||||
helper.dispose();
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [camera, controls, scene, toggleView, selectedAssets, copiedObjects, pastedObjects, duplicatedObjects, movedObjects, socket, rotatedObjects, activeModule, toolMode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (activeModule !== "builder" || toolMode !== 'cursor' || toggleView) {
|
||||
clearSelection();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeModule, toolMode, toggleView]);
|
||||
|
||||
const selectAssets = useCallback(() => {
|
||||
@@ -362,7 +365,7 @@ const SelectionControls3D: React.FC = () => {
|
||||
removeAsset(uuid);
|
||||
});
|
||||
|
||||
echo.success("Selected models removed!");
|
||||
echo.warn("Selected models removed!");
|
||||
clearSelection();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user