mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-09 03:22:49 +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
|
if (!editing) return
|
||||||
editing = false
|
editing = false
|
||||||
if (pressedKeys.size < 2) return
|
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.update(changes => {
|
||||||
changes.push({
|
changes.push({
|
||||||
type: ChangeType.Chord,
|
type: ChangeType.Chord,
|
||||||
id: chord!.id,
|
id: chord!.id,
|
||||||
actions: [...pressedKeys].sort(),
|
actions: [...pressedKeys].sort((a, b) => a - b),
|
||||||
phrase: chord!.phrase,
|
phrase: chord!.phrase,
|
||||||
})
|
})
|
||||||
return changes
|
return changes
|
||||||
@@ -54,7 +58,10 @@
|
|||||||
{:else if !editing && !chord}
|
{:else if !editing && !chord}
|
||||||
<span>{$LL.configure.chords.NEW_CHORD()}</span>
|
<span>{$LL.configure.chords.NEW_CHORD()}</span>
|
||||||
{/if}
|
{/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>
|
<sup>•</sup>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
0
src/routes/vocabulary/+page.svelte
Normal file
0
src/routes/vocabulary/+page.svelte
Normal file
Reference in New Issue
Block a user