mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-03 08:32:52 +00:00
fix: imported chords not filtered
This commit is contained in:
@@ -109,9 +109,9 @@ export function restoreFromFile(
|
|||||||
|
|
||||||
export function getChangesFromChordFile(file: CharaChordFile) {
|
export function getChangesFromChordFile(file: CharaChordFile) {
|
||||||
const changes: Change[] = []
|
const changes: Change[] = []
|
||||||
const existingChords = new Set(get(chords).map(({phrase, actions}) => JSON.stringify({phrase, actions})))
|
const existingChords = new Set(get(chords).map(({phrase, actions}) => JSON.stringify([actions, phrase])))
|
||||||
for (const [input, output] of file.chords) {
|
for (const [input, output] of file.chords) {
|
||||||
if (existingChords.has(JSON.stringify({actions: input, phrase: output}))) {
|
if (existingChords.has(JSON.stringify([input, output]))) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
changes.push({
|
changes.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user