fix: only import settings that already exist

This commit is contained in:
2023-12-07 19:06:49 +01:00
parent 77339620e6
commit d552fb9220
2 changed files with 3 additions and 6 deletions

View File

@@ -132,7 +132,8 @@ export function getChangesFromChordFile(file: CharaChordFile) {
export function getChangesFromSettingsFile(file: CharaSettingsFile) {
const changes: Change[] = []
for (const [id, value] of file.settings.entries()) {
if (get(settings)[id].value !== value) {
const setting = get(settings)[id]
if (setting !== undefined && setting.value !== value) {
changes.push({
type: ChangeType.Setting,
id,

View File

@@ -75,11 +75,7 @@
}
for (const [id, setting] of $overlay.settings) {
try {
await port.setSetting(id, setting)
} catch (e) {
console.log("Skipping invalid ID", e)
}
await port.setSetting(id, setting)
}
// Yes, this is a completely arbitrary and unnecessary delay.