armbot position updated
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user