armbot position updated

This commit is contained in:
2025-05-02 18:33:27 +05:30
parent 53055a0b82
commit 80e7bf4bf9
7 changed files with 16 additions and 16 deletions

View File

@@ -8,8 +8,8 @@ import { usePlayButtonStore } from "../../../store/usePlayButtonStore";
import ArmBotUI from "../ui/arm/armBotUI";
function RoboticArm() {
const { armBots, addArmBot, removeArmBot } = useArmBotStore();
const { getProductById } = useProductStore();
const { armBots, addArmBot, clearArmBots } = useArmBotStore();
const { products, getProductById } = useProductStore();
const { selectedProduct } = useSelectedProduct();
const { selectedEventSphere } = useSelectedEventSphere();
const { selectedEventData } = useSelectedEventData();
@@ -161,20 +161,15 @@ function RoboticArm() {
if (selectedProduct.productId) {
const product = getProductById(selectedProduct.productId);
if (product) {
clearArmBots();
product.eventDatas.forEach(events => {
if (events.type === 'roboticArm') {
removeArmBot(events.modelUuid);
addArmBot(selectedProduct.productId, events);
}
});
}
}
}, [selectedProduct]);
// useEffect(()=>{
// // removeArmBot("123", armBotStatusSample[0]);
// addArmBot("123", armBotStatusSample[0]);
// },[])
}, [selectedProduct, products]);
useEffect(() => {