From fa729b958d4b4230f7d67830a513e991c2c2c4c5 Mon Sep 17 00:00:00 2001 From: Pipe-Runner Date: Wed, 31 May 2023 01:31:09 +0200 Subject: [PATCH] Fixed re-compute bug --- src/components/EditorPanel/components/InputControls.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/EditorPanel/components/InputControls.js b/src/components/EditorPanel/components/InputControls.js index c5fa783..8780817 100644 --- a/src/components/EditorPanel/components/InputControls.js +++ b/src/components/EditorPanel/components/InputControls.js @@ -130,6 +130,7 @@ function SimulationControls({ isDisabled }) { const { asyncRun } = useContext(PyodideContext); const setSimulationData = useStore((state) => state.setSimulationData); + const setAnimating = useStore((state) => state.setAnimating); const [force, setForce] = useState(DefaultValues.force); const [theta, setTheta] = useState(DefaultValues.theta); @@ -169,6 +170,7 @@ function SimulationControls({ isDisabled }) { }, [processedData]); const computeSimulation = async () => { + setAnimating("stopped"); setSimulationData(null); const code = await extractScriptText(script);