reset for example patterns
This commit is contained in:
parent
e01c6dc18d
commit
78f6fdf169
3 changed files with 14 additions and 66 deletions
|
|
@ -164,7 +164,17 @@ export function Repl({ embedded = false }) {
|
|||
editorRef.current?.toggle();
|
||||
};
|
||||
|
||||
const handleUpdate = (id, code) => {
|
||||
const resetEditor = async () => {
|
||||
clearCanvas();
|
||||
resetLoadedSounds();
|
||||
editorRef.current.repl.setCps(1);
|
||||
await prebake(); // declare default samples
|
||||
};
|
||||
|
||||
const handleUpdate = async (id, code, reset = false) => {
|
||||
if (reset) {
|
||||
await resetEditor();
|
||||
}
|
||||
setViewingPattern(id);
|
||||
editorRef.current.setCode(code);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue