fix:
- react-hooks/exhaustive-deps added - style update - key fix
This commit is contained in:
@@ -78,8 +78,8 @@ const AssetProperties: React.FC = () => {
|
||||
|
||||
<section>
|
||||
<div className="header">User Data</div>
|
||||
{userData.map((data) => (
|
||||
<div className="input-container">
|
||||
{userData.map((data, i) => (
|
||||
<div className="input-container" key={i}>
|
||||
<InputWithDropDown
|
||||
key={data.id}
|
||||
label={data.label}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
border-radius: #{$border-radius-large};
|
||||
outline: 1px solid var(--border-color);
|
||||
z-index: 100;
|
||||
backdrop-filter: blur(4px);
|
||||
.header {
|
||||
@include flex-center;
|
||||
gap: 8px;
|
||||
|
||||
Reference in New Issue
Block a user