Merge remote-tracking branch 'origin/main-dev' into main-demo

This commit is contained in:
2025-08-22 17:59:02 +05:30
4 changed files with 5 additions and 11 deletions

View File

@@ -17,7 +17,7 @@ function CraneMechanics() {
const { selectedEventData } = useSelectedEventData();
const { productStore } = useSceneContext();
const { getPointByUuid, updateAction, addAction, removeAction } = productStore();
const { getPointByUuid, addAction, removeAction } = productStore();
const { selectedProductStore } = useProductContext();
const { selectedProduct } = selectedProductStore();
const { selectedAction, setSelectedAction, clearSelectedAction } = useSelectedAction();

View File

@@ -47,6 +47,7 @@ function HumanMechanics() {
if (point?.actions?.length) {
setSelectedPointData(point);
const firstAction = point.actions[0];
setSelectedAction(firstAction.actionUuid, firstAction.actionName);
setCurrentAction(firstAction);
setSpeed((
getEventByModelUuid(

View File

@@ -29,7 +29,7 @@ function RoboticArmMechanics() {
const { projectId } = useParams();
useEffect(() => {
if (selectedEventData) {
if (selectedEventData && selectedEventData.data.type === 'roboticArm') {
const point = getPointByUuid(
selectedProduct.productUuid,
selectedEventData.data.modelUuid,

View File

@@ -48,15 +48,8 @@ function StorageMechanics() {
setCurrentCapacity(eventData?.storageCapacity?.toString() || "1");
setSpawnedCount(eventData?.storageCount?.toString() || "0");
setSpawnedMaterial(eventData?.materialType?.toString() || "Default material");
const actionUuid = selectedAction.actionId || firstAction.actionUuid;
const newCurrentAction = getActionByUuid(selectedProduct.productUuid, actionUuid);
if (newCurrentAction) {
const uiOption = newCurrentAction.actionType === "retrieve" ? "spawn" : "store";
setActiveOption(uiOption);
setSelectedAction(newCurrentAction.actionUuid, newCurrentAction.actionName);
}
setSelectedAction(firstAction.actionUuid, firstAction.actionName);
setActiveOption(firstAction.actionType === "retrieve" ? "spawn" : "store");
}
} else {
clearSelectedAction();