Skip to content

Commit

Permalink
fix: chord actions not sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaninova committed Nov 18, 2023
1 parent 683561d commit e84470d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Empty file.
13 changes: 10 additions & 3 deletions src/routes/config/chords/ChordActionEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@
if (!editing) return
editing = false
if (pressedKeys.size < 2) return
if (!chord) return dispatch("submit", [...pressedKeys].sort())
if (!chord)
return dispatch(
"submit",
[...pressedKeys].sort((a, b) => a - b),
)
changes.update(changes => {
changes.push({
type: ChangeType.Chord,
id: chord!.id,
actions: [...pressedKeys].sort(),
actions: [...pressedKeys].sort((a, b) => a - b),
phrase: chord!.phrase,
})
return changes
Expand All @@ -54,7 +58,10 @@
{:else if !editing && !chord}
<span>{$LL.configure.chords.NEW_CHORD()}</span>
{/if}
<ActionString display="keys" actions={editing ? [...pressedKeys].sort() : chord?.actions ?? []} />
<ActionString
display="keys"
actions={editing ? [...pressedKeys].sort((a, b) => a - b) : chord?.actions ?? []}
/>
<sup>•</sup>
</button>

Expand Down
Empty file.

0 comments on commit e84470d

Please sign in to comment.