diff --git a/src/i18n/de/index.ts b/src/i18n/de/index.ts index 9f4a2faf..99d0c72d 100644 --- a/src/i18n/de/index.ts +++ b/src/i18n/de/index.ts @@ -108,6 +108,7 @@ const de = { TITLE: "Akkorde", HOLD_KEYS: "Akkord halten", NEW_CHORD: "Neuer Akkord", + DUPLICATE: "Akkord existiert bereits", search: { PLACEHOLDER: "{0} Akkord{{|e}} durchsuchen", }, diff --git a/src/i18n/en/index.ts b/src/i18n/en/index.ts index a97eacd1..12ed3927 100644 --- a/src/i18n/en/index.ts +++ b/src/i18n/en/index.ts @@ -104,6 +104,7 @@ const en = { TITLE: "Chords", HOLD_KEYS: "Hold chord", NEW_CHORD: "New chord", + DUPLICATE: "Chord already exists", search: { PLACEHOLDER: "Search {0} chord{{|s}}", }, diff --git a/src/routes/config/chords/+page.svelte b/src/routes/config/chords/+page.svelte index b260fbcd..2aee9f52 100644 --- a/src/routes/config/chords/+page.svelte +++ b/src/routes/config/chords/+page.svelte @@ -55,6 +55,11 @@ } function insertChord(actions: number[]) { + const id = JSON.stringify(actions) + if ($chords.some(it => JSON.stringify(it.actions) === id)) { + alert($LL.configure.chords.DUPLICATE()) + return + } changes.update(changes => { changes.push({ type: ChangeType.Chord,