refactor: Clean up console log statements and improve component state management in SideBarRight, AssetProperties, WallInstances, WallCreator, and SocketResponses

This commit is contained in:
2025-07-02 11:52:57 +05:30
parent 0848c453af
commit 3f59f5d2dd
6 changed files with 135 additions and 143 deletions

View File

@@ -99,8 +99,6 @@ function Model({ asset }: { readonly asset: Asset }) {
const action = mixerRef.current!.clipAction(animation);
actions.current[animation.name] = action;
});
} else {
console.log('No animations');
}
return;
}
@@ -211,7 +209,6 @@ function Model({ asset }: { readonly asset: Asset }) {
const handleClick = (asset: Asset) => {
if (activeTool === 'delete' && deletableFloorItem && deletableFloorItem.uuid === asset.modelUuid) {
//REST
// const response = await deleteFloorItem(organization, asset.modelUuid, asset.modelName);
@@ -305,7 +302,6 @@ function Model({ asset }: { readonly asset: Asset }) {
useEffect(() => {
const handlePlay = (clipName: string) => {
console.log('clipName: ', clipName, asset.animationState);
if (!mixerRef.current) return;
Object.values(actions.current).forEach((action) => action.stop());
@@ -313,9 +309,6 @@ function Model({ asset }: { readonly asset: Asset }) {
const action = actions.current[clipName];
if (action && asset.animationState?.playing) {
action.reset().setLoop(THREE.LoopOnce, 1).play();
console.log(`Playing: ${clipName}`);
} else {
console.warn(`No action found for: ${clipName}`);
}
};

View File

@@ -41,7 +41,7 @@ function WallInstances() {
return (
<>
{!toggleView && walls.length > 1 && (
{!toggleView && (
<>
{walls.map((wall) => (
<WallInstance key={wall.wallUuid} wall={wall} />

View File

@@ -71,7 +71,6 @@ function WallCreator() {
if (wallIntersect && !pointIntersects) {
const wall = getWallByPoints(wallIntersect.object.userData.points);
console.log('wall: ', wall);
if (wall) {
const ThroughPoint = wallIntersect.object.userData.path.getPoints(Constants.lineConfig.lineIntersectionPoints);
let intersectionPoint = getClosestIntersection(ThroughPoint, wallIntersect.point);
@@ -295,9 +294,7 @@ function WallCreator() {
position: [position.x, position.y, position.z],
layer: activeLayer
};
console.log('newPoint: ', newPoint);
console.log('snappedPoint: ', snappedPoint);
if (snappedPosition && snappedPoint) {
newPoint.pointUuid = snappedPoint.pointUuid;
newPoint.position = snappedPosition;
@@ -319,7 +316,6 @@ function WallCreator() {
}
}
console.log('tempPoints: ', tempPoints);
if (tempPoints.length === 0) {
setTempPoints([newPoint]);
setIsCreating(true);
@@ -334,7 +330,6 @@ function WallCreator() {
decals: []
};
addWall(wall);
console.log('wall: ', wall);
// API

View File

@@ -5,11 +5,12 @@ export default function SocketResponses() {
const { socket } = useSocketStore();
useEffect(() => {
socket.on("v1:wall-asset:response:delete", (data: any) => {
socket.on("v1:model-asset:response:add", (data: any) => {
console.log('data: ', data);
});
return () => {
socket.off("v1:wall-asset:response:delete");
socket.off("v1:model-asset:response:add");
}
}, [socket])