fix: duplicate chords crash

fix: duplicate confirm dialog does not show affected chord
fixes #137
fixes #163
This commit is contained in:
2025-02-14 15:17:22 +01:00
parent fb1f5b7ec7
commit f319714489
4 changed files with 56 additions and 31 deletions

View File

@@ -13,7 +13,12 @@
let {
chord = undefined,
onsubmit,
}: { chord?: ChordInfo; onsubmit: (actions: number[]) => void } = $props();
interactive = true,
}: {
chord?: ChordInfo;
interactive?: boolean;
onsubmit: (actions: number[]) => void;
} = $props();
let pressedKeys = new SvelteSet<number>();
let editing = $state(false);
@@ -129,6 +134,7 @@
onkeydown={keydown}
onkeyup={keyup}
onblur={keyup}
disabled={!interactive}
>
{#if editing && pressedKeys.size === 0}
<span>{$LL.configure.chords.HOLD_KEYS()}</span>