fix: update comparison operators to strict equality in roboticArmInstance

This commit is contained in:
2025-09-15 17:07:43 +05:30
parent bc0fb64720
commit 5087e941fc
2 changed files with 5 additions and 5 deletions

View File

@@ -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";

View File

@@ -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");