about summary refs log tree commit diff
path: root/website
diff options
context:
space:
mode:
Diffstat (limited to 'website')
-rw-r--r--website/sandbox/learnpianochords/src/State.elm8
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