From 04d5f51920a149719a3c7b57f5425939e024ba1b Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Tue, 14 Oct 2025 11:06:29 +0530 Subject: [PATCH] Refactor GroupControls and Products components to improve API call conditions and remove commented-out code --- .../scene/controls/assetControls/groupControls.tsx | 10 +++++----- app/src/modules/simulation/products/products.tsx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/modules/scene/controls/assetControls/groupControls.tsx b/app/src/modules/scene/controls/assetControls/groupControls.tsx index b31f09a..6040f32 100644 --- a/app/src/modules/scene/controls/assetControls/groupControls.tsx +++ b/app/src/modules/scene/controls/assetControls/groupControls.tsx @@ -28,11 +28,11 @@ function GroupControls() { useEffect(() => { if (!projectId || !selectedVersion) return; - getAssetGroupsApi(projectId, selectedVersion.versionId).then((data) => { - if (data && data.length > 0) { - setGroups(data); - } - }); + // getAssetGroupsApi(projectId, selectedVersion.versionId).then((data) => { + // if (data && data.length > 0) { + // setGroups(data); + // } + // }); }, [projectId, selectedVersion]); useEffect(() => { diff --git a/app/src/modules/simulation/products/products.tsx b/app/src/modules/simulation/products/products.tsx index 3afe63f..0052747 100644 --- a/app/src/modules/simulation/products/products.tsx +++ b/app/src/modules/simulation/products/products.tsx @@ -40,7 +40,7 @@ function Products() { }, [comparisonScene, layout]); useEffect(() => { - if (!selectedVersion || !simulationSocket || selectedProduct.productUuid !== "" || !projectId) return; + if (!selectedVersion || !simulationSocket || !projectId) return; getAllProductsApi(projectId || "", selectedVersion.versionId) .then((data) => { if (data && data.length === 0) { @@ -112,7 +112,7 @@ function Products() { .catch((err) => { console.error(err); }); - }, [selectedVersion?.versionId, simulationSocket, selectedProduct, projectId, userId, organization]); + }, [selectedVersion?.versionId, simulationSocket, projectId, userId, organization]); useEffect(() => { if (selectedProduct.productUuid) {