Refactor: Add setDfxUploaded to useDfxUpload hook and update useEffect to reset uploaded data on toggle view change
This commit is contained in:
@@ -17,7 +17,7 @@ import { useSceneContext } from '../../scene/sceneContext';
|
|||||||
*/
|
*/
|
||||||
const DxfFile = () => {
|
const DxfFile = () => {
|
||||||
// State management hooks
|
// State management hooks
|
||||||
const { dfxuploaded, dfxWallGenerate, setObjValue, objValue } = useDfxUpload();
|
const { dfxuploaded, dfxWallGenerate, setObjValue, objValue, setDfxUploaded } = useDfxUpload();
|
||||||
const { toggleView } = useToggleView();
|
const { toggleView } = useToggleView();
|
||||||
const { socket } = useSocketStore();
|
const { socket } = useSocketStore();
|
||||||
const { selectedVersionStore } = useVersionContext();
|
const { selectedVersionStore } = useVersionContext();
|
||||||
@@ -80,7 +80,11 @@ const DxfFile = () => {
|
|||||||
wallThickness, wallHeight, outsideMaterial, insideMaterial, activeLayer, addWall, walls
|
wallThickness, wallHeight, outsideMaterial, insideMaterial, activeLayer, addWall, walls
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (!toggleView) {
|
||||||
|
setDfxUploaded([])
|
||||||
|
}
|
||||||
|
}, [toggleView])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Render DXF lines with transform controls when DXF data is available and view is toggled */}
|
{/* Render DXF lines with transform controls when DXF data is available and view is toggled */}
|
||||||
|
|||||||
Reference in New Issue
Block a user