From 541c40cd2f0524cfa4c70c531c0ed6e7803ffda2 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 19 Apr 2020 18:56:51 +0100 Subject: Ensure only whitelisted chord inversions present in initial state Whoops... --- website/sandbox/learnpianochords/src/State.elm | 8 ++++++-- 1 file 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 -- cgit 1.4.1