config: fix errors
Check before assigning cause of compat colours
This commit is contained in:
parent
571f3312b2
commit
571721ff39
1 changed files with 4 additions and 1 deletions
|
|
@ -31,11 +31,14 @@ Singleton {
|
||||||
onFileChanged: this.reload()
|
onFileChanged: this.reload()
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
const contents = this.text();
|
const contents = this.text();
|
||||||
|
const colours = root.colours;
|
||||||
|
|
||||||
for (const line of contents.split("\n")) {
|
for (const line of contents.split("\n")) {
|
||||||
let [name, colour] = line.split(" ");
|
let [name, colour] = line.split(" ");
|
||||||
name = name.trim();
|
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()}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue