mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-03 08:32:52 +00:00
fix: chord actions not sorted
This commit is contained in:
0
src/routes/bootcamp/+page.svelte
Normal file
0
src/routes/bootcamp/+page.svelte
Normal file
@@ -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
|
||||
@@ -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>
|
||||
|
||||
|
||||
0
src/routes/vocabulary/+page.svelte
Normal file
0
src/routes/vocabulary/+page.svelte
Normal file
Reference in New Issue
Block a user