fix: broken checkbox default parsing
This commit is contained in:
parent
e350883b72
commit
3cf60f8daa
|
@ -250,14 +250,12 @@ function ThemesTab() {
|
||||||
switch (varInfo.type) {
|
switch (varInfo.type) {
|
||||||
case "text":
|
case "text":
|
||||||
case "color":
|
case "color":
|
||||||
|
case "checkbox":
|
||||||
normalizedValue = varInfo.default;
|
normalizedValue = varInfo.default;
|
||||||
break;
|
break;
|
||||||
case "select":
|
case "select":
|
||||||
normalizedValue = varInfo.options.find(v => v.name === varInfo.default)!.value;
|
normalizedValue = varInfo.options.find(v => v.name === varInfo.default)!.value;
|
||||||
break;
|
break;
|
||||||
case "checkbox":
|
|
||||||
normalizedValue = varInfo.default ? "1" : "0";
|
|
||||||
break;
|
|
||||||
case "range":
|
case "range":
|
||||||
normalizedValue = `${varInfo.default}${varInfo.units}`;
|
normalizedValue = `${varInfo.default}${varInfo.units}`;
|
||||||
break;
|
break;
|
||||||
|
|
2
src/utils/themes/usercss/usercss-meta.d.ts
vendored
2
src/utils/themes/usercss/usercss-meta.d.ts
vendored
|
@ -19,7 +19,7 @@ declare module "usercss-meta" {
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: "checkbox";
|
type: "checkbox";
|
||||||
default: boolean;
|
default: string;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: "range";
|
type: "range";
|
||||||
|
|
Loading…
Reference in a new issue