mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-11 13:26:16 +00:00
feat: reject new chords that override another chord
This commit is contained in:
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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}}",
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user