removed consoles in comparing layouts
This commit is contained in:
@@ -12,10 +12,12 @@ import Scene from "../../../modules/scene/scene";
|
||||
import useRestStates from "../../../hooks/useResetStates";
|
||||
|
||||
import { getVersionHistoryApi } from "../../../services/factoryBuilder/versionControl/getVersionHistoryApi";
|
||||
import { useSimulationManager } from "../../../store/rough/useSimulationManagerStore";
|
||||
import { validateSimulationDataApi } from "../../../services/simulation/comparison/validateSimulationDataApi";
|
||||
|
||||
const CompareLayOut = () => {
|
||||
const { clearComparisonState, comparisonScene, setComparisonState } = useSimulationState();
|
||||
const { versionStore } = useSceneContext();
|
||||
const { versionStore, productStore } = useSceneContext();
|
||||
const { versionHistory, selectedVersion, setSelectedVersion, clearSelectedVersion, setVersions } = versionStore();
|
||||
const { setLoadingProgress } = useLoadingProgress();
|
||||
const [width, setWidth] = useState("50vw");
|
||||
@@ -29,7 +31,8 @@ const CompareLayOut = () => {
|
||||
const { setIsPlaying } = usePlayButtonStore();
|
||||
const { projectId } = useParams();
|
||||
const { resetStates } = useRestStates();
|
||||
|
||||
const { products } = productStore();
|
||||
const { addSimulationRecord } = useSimulationManager();
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
resetStates();
|
||||
@@ -65,6 +68,7 @@ const CompareLayOut = () => {
|
||||
if (!comparisonScene) {
|
||||
clearSelectedVersion();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [comparisonScene]);
|
||||
|
||||
OuterClick({
|
||||
@@ -161,13 +165,24 @@ const CompareLayOut = () => {
|
||||
};
|
||||
setComparisonState(comparisonData);
|
||||
setLoadingProgress(1);
|
||||
const singleData = {
|
||||
projectId: projectId,
|
||||
versionId: version.versionId, // use version directly, not selectedVersion
|
||||
productUuid: data[0].productUuid, // productUuid is already a string
|
||||
};
|
||||
console.log("products", products);
|
||||
validateSimulationDataApi(singleData).then((getData) => {
|
||||
echo.log(getData.message);
|
||||
const getSimulate = getData?.data;
|
||||
addSimulationRecord(projectId, selectedVersion?.versionId || "", data[0].productUuid || "", getSimulate.data);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`compareLayOut-wrapper ${width === "0px" ? "closed" : ""}`} ref={wrapperRef} style={{ width }}>
|
||||
{loadingProgress == 0 && selectedVersion?.versionId && (
|
||||
{loadingProgress === 0 && selectedVersion?.versionId && (
|
||||
<button title="resize-canvas" id="compare-resize-slider-btn" className="resizer" onMouseDown={handleStartResizing}>
|
||||
<ResizerIcon />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user