diff --git a/src/components/PreviewComponent.tsx b/src/components/PreviewComponent.tsx index 9d71e82..6d3a77a 100644 --- a/src/components/PreviewComponent.tsx +++ b/src/components/PreviewComponent.tsx @@ -84,7 +84,7 @@ const PreviewComponent: React.FC = ({ if (url && color) { loadModelAndCheckDimensions(url); } - }, [url, color]); + }, [url]); const initializeScene = () => { renderer.setSize(600, 400); // Fixed size @@ -178,10 +178,10 @@ const PreviewComponent: React.FC = ({ }; useEffect(() => { - if (modelLoaded && color) { + if (modelLoaded) { updateMaterialColor(parseInt(color.replace("#", ""), 16)); } - }, [color, modelLoaded]); + }, [color]); const updateDimensions = () => { const boundingBox = new THREE.Box3().setFromObject(meshRef.current!);