Skip to content

Commit

Permalink
Fix sequencer states accidentally linking
Browse files Browse the repository at this point in the history
  • Loading branch information
oamaok committed Oct 19, 2021
1 parent 272c8b8 commit e820bb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist
client/generated
client/src/generated
server/migrations/
22 changes: 10 additions & 12 deletions client/src/components/modules/Sequencer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ type SequencerState = {
notes: Note[]
}

const initialState: SequencerState = {
editing: 0,
notes: Array(16)
.fill(null)
.map(() => ({
name: 'A',
octave: 4,
gate: true,
})),
}

class Sequencer extends Component<Props> implements IModule {
node: WorkletNode<'Sequencer'>

Expand All @@ -70,7 +59,16 @@ class Sequencer extends Component<Props> implements IModule {
})

if (!getModuleState<SequencerState>(props.id)) {
setModuleState(props.id, initialState)
setModuleState(props.id, {
editing: 0,
notes: Array(16)
.fill(null)
.map(() => ({
name: 'A',
octave: 4,
gate: true,
})),
})
}

useEffect(() => {
Expand Down

0 comments on commit e820bb3

Please sign in to comment.