config: fix errors

Check before assigning cause of compat colours
This commit is contained in:
2 * r + 2 * t 2025-04-30 22:22:01 +10:00
parent 571f3312b2
commit 571721ff39

View file

@ -31,11 +31,14 @@ Singleton {
onFileChanged: this.reload()
onLoaded: {
const contents = this.text();
const colours = root.colours;
for (const line of contents.split("\n")) {
let [name, colour] = line.split(" ");
name = name.trim();
root.colours[colourNames.includes(name) ? name : `m3${name}`] = `#${colour.trim()}`;
name = colourNames.includes(name) ? name : `m3${name}`;
if (colours.hasOwnProperty(name))
colours[name] = `#${colour.trim()}`;
}
}
}