Merge remote-tracking branch 'origin/main-dev' into main-demo
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user