From 8e5692ca59cfdc95326bef1113ec8bd899be8e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Sat, 18 Nov 2023 18:49:15 +0100 Subject: [PATCH] fix: imported chords not filtered --- src/lib/backup/backup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/backup/backup.ts b/src/lib/backup/backup.ts index 9b29a446..524bb193 100644 --- a/src/lib/backup/backup.ts +++ b/src/lib/backup/backup.ts @@ -109,9 +109,9 @@ export function restoreFromFile( export function getChangesFromChordFile(file: CharaChordFile) { 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) { - if (existingChords.has(JSON.stringify({actions: input, phrase: output}))) { + if (existingChords.has(JSON.stringify([input, output]))) { continue } changes.push({