fix: update comparison operators to strict equality in roboticArmInstance
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from "react";
|
||||
import { DepthOfField, Bloom, EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import { EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import OutlineInstances from "./outlineInstances/outlineInstances";
|
||||
import { useDeletableEventSphere, useSelectedEventSphere } from "../../../store/simulation/useSimulationStore";
|
||||
|
||||
|
||||
@@ -284,25 +284,25 @@ function RoboticArmInstance({ armBot }: { readonly armBot: ArmBotStatus }) {
|
||||
}
|
||||
|
||||
const HandleCallback = () => {
|
||||
if (armBot.isActive && armBot.state == "running" && currentPhase == "init-to-rest") {
|
||||
if (armBot.isActive && armBot.state === "running" && currentPhase === "init-to-rest") {
|
||||
logStatus(armBot.modelUuid, "Callback triggered: rest");
|
||||
setArmBotActive(armBot.modelUuid, false);
|
||||
setArmBotState(armBot.modelUuid, "idle");
|
||||
setCurrentPhase("rest");
|
||||
setPath([]);
|
||||
} else if (armBot.state == "running" && currentPhase == "rest-to-start") {
|
||||
} else if (armBot.state === "running" && currentPhase === "rest-to-start") {
|
||||
logStatus(armBot.modelUuid, "Callback triggered: pick.");
|
||||
setArmBotActive(armBot.modelUuid, false);
|
||||
setArmBotState(armBot.modelUuid, "running");
|
||||
setCurrentPhase("picking");
|
||||
setPath([]);
|
||||
} else if (armBot.isActive && armBot.state == "running" && currentPhase == "start-to-end") {
|
||||
} else if (armBot.isActive && armBot.state === "running" && currentPhase === "start-to-end") {
|
||||
logStatus(armBot.modelUuid, "Callback triggered: drop.");
|
||||
setArmBotActive(armBot.modelUuid, false);
|
||||
setArmBotState(armBot.modelUuid, "running");
|
||||
setCurrentPhase("dropping");
|
||||
setPath([]);
|
||||
} else if (armBot.isActive && armBot.state == "running" && currentPhase == "end-to-rest") {
|
||||
} else if (armBot.isActive && armBot.state === "running" && currentPhase === "end-to-rest") {
|
||||
logStatus(armBot.modelUuid, "Callback triggered: rest, cycle completed.");
|
||||
setArmBotActive(armBot.modelUuid, false);
|
||||
setArmBotState(armBot.modelUuid, "idle");
|
||||
|
||||
Reference in New Issue
Block a user