autoplay and reset cps on default

This commit is contained in:
Jade (Rose) Rowland 2024-01-21 12:12:33 -05:00
parent b1d49552ae
commit 961e931c31
2 changed files with 10 additions and 5 deletions

View file

@ -164,11 +164,12 @@ export function Repl({ embedded = false }) {
};
const handleUpdate = async (patternData, reset = false) => {
if (reset) {
await resetEditor();
}
setViewingPatternData(patternData);
editorRef.current.setCode(patternData.code);
if (reset) {
await resetEditor();
handleEvaluate();
}
};
const handleEvaluate = () => {