diff options
author | William Carroll <wpcarro@gmail.com> | 2020-04-19T17·56+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-04-19T18·02+0100 |
commit | 541c40cd2f0524cfa4c70c531c0ed6e7803ffda2 (patch) | |
tree | 13394e2bc7e0fee0be94cc66916429393266d526 /website | |
parent | a059c32403b2baa8298fef39ce39ff3324e65944 (diff) |
Ensure only whitelisted chord inversions present in initial state
Whoops...
Diffstat (limited to 'website')
-rw-r--r-- | website/sandbox/learnpianochords/src/State.elm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/website/sandbox/learnpianochords/src/State.elm b/website/sandbox/learnpianochords/src/State.elm index 3b9d29c34443..764c8b2564fd 100644 --- a/website/sandbox/learnpianochords/src/State.elm +++ b/website/sandbox/learnpianochords/src/State.elm @@ -63,7 +63,9 @@ init = [ { pitchClass = Theory.C, mode = Theory.MajorMode } ] in { whitelistedChords = - keys |> List.concatMap Theory.chordsForKey + keys + |> List.concatMap Theory.chordsForKey + |> List.filter (\chord -> List.member chord.chordInversion inversions) , whitelistedChordTypes = chordTypes , whitelistedInversions = inversions , whitelistedPitchClasses = pitchClasses @@ -200,7 +202,9 @@ update msg model = ( { model | whitelistedKeys = keys , whitelistedChords = - keys |> List.concatMap Theory.chordsForKey + keys + |> List.concatMap Theory.chordsForKey + |> List.filter (\chord -> List.member chord.chordInversion model.whitelistedInversions) , selectedChord = Nothing } , Cmd.none |