From be8f937759de638d767c4a0fbe2789da2ad29e98 Mon Sep 17 00:00:00 2001 From: Gomathi9520 Date: Mon, 5 May 2025 11:25:06 +0530 Subject: [PATCH] reset function updated --- .../ui/simulation/simulationPlayer.tsx | 20 +- .../instances/animator/roboticArmAnimator.tsx | 446 +++++++++--------- .../armInstance/roboticArmInstance.tsx | 34 +- .../simulation/simulator/simulator.tsx | 2 +- 4 files changed, 264 insertions(+), 238 deletions(-) diff --git a/app/src/components/ui/simulation/simulationPlayer.tsx b/app/src/components/ui/simulation/simulationPlayer.tsx index 2d9d4e3..9787d00 100644 --- a/app/src/components/ui/simulation/simulationPlayer.tsx +++ b/app/src/components/ui/simulation/simulationPlayer.tsx @@ -38,9 +38,17 @@ const SimulationPlayer: React.FC = () => { const { isReset, setReset } = useResetButtonStore(); const { subModule } = useSubModuleStore(); + useEffect(() => { + if (isReset) { + setTimeout(()=>{ + setReset(false); + },0) + } + }, [isReset]) + // Button functions const handleReset = () => { - setReset(!isReset); + setReset(true); setSpeed(1); }; const handlePlayStop = () => { @@ -271,11 +279,10 @@ const SimulationPlayer: React.FC = () => { {index < intervals.length - 1 && (
= ((index + 1) / totalSegments) * 100 + className={`line ${progress >= ((index + 1) / totalSegments) * 100 ? "filled" : "" - }`} + }`} >
)} @@ -314,9 +321,8 @@ const SimulationPlayer: React.FC = () => {