mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-04 17:12:51 +00:00
fix: only import settings that already exist
This commit is contained in:
@@ -132,7 +132,8 @@ export function getChangesFromChordFile(file: CharaChordFile) {
|
|||||||
export function getChangesFromSettingsFile(file: CharaSettingsFile) {
|
export function getChangesFromSettingsFile(file: CharaSettingsFile) {
|
||||||
const changes: Change[] = []
|
const changes: Change[] = []
|
||||||
for (const [id, value] of file.settings.entries()) {
|
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({
|
changes.push({
|
||||||
type: ChangeType.Setting,
|
type: ChangeType.Setting,
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -75,11 +75,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const [id, setting] of $overlay.settings) {
|
for (const [id, setting] of $overlay.settings) {
|
||||||
try {
|
await port.setSetting(id, setting)
|
||||||
await port.setSetting(id, setting)
|
|
||||||
} catch (e) {
|
|
||||||
console.log("Skipping invalid ID", e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Yes, this is a completely arbitrary and unnecessary delay.
|
// Yes, this is a completely arbitrary and unnecessary delay.
|
||||||
|
|||||||
Reference in New Issue
Block a user