fix: sometimes wouldnt start the first time
This commit is contained in:
parent
2efbb68627
commit
72b963fb21
2 changed files with 13 additions and 5 deletions
|
|
@ -25,13 +25,13 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw }: any)
|
|||
const activateCode = async (_code = code) => {
|
||||
if (activeCode && !dirty) {
|
||||
setError(undefined);
|
||||
!cycle.started && cycle.start();
|
||||
cycle.start();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
setPending(true);
|
||||
const parsed = await evaluate(_code);
|
||||
!cycle.started && cycle.start();
|
||||
cycle.start();
|
||||
broadcast({ type: 'start', from: id });
|
||||
setPattern(() => parsed.pattern);
|
||||
if (autolink) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue