fix: broken checkbox default parsing
This commit is contained in:
parent
e350883b72
commit
3cf60f8daa
|
@ -250,14 +250,12 @@ function ThemesTab() {
|
|||
switch (varInfo.type) {
|
||||
case "text":
|
||||
case "color":
|
||||
case "checkbox":
|
||||
normalizedValue = varInfo.default;
|
||||
break;
|
||||
case "select":
|
||||
normalizedValue = varInfo.options.find(v => v.name === varInfo.default)!.value;
|
||||
break;
|
||||
case "checkbox":
|
||||
normalizedValue = varInfo.default ? "1" : "0";
|
||||
break;
|
||||
case "range":
|
||||
normalizedValue = `${varInfo.default}${varInfo.units}`;
|
||||
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";
|
||||
default: boolean;
|
||||
default: string;
|
||||
}
|
||||
| {
|
||||
type: "range";
|
||||
|
|
Loading…
Reference in a new issue