fix: broken checkbox default parsing

This commit is contained in:
Lewis Crichton 2024-01-14 16:11:26 +00:00
parent e350883b72
commit 3cf60f8daa
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -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;

View file

@ -19,7 +19,7 @@ declare module "usercss-meta" {
} }
| { | {
type: "checkbox"; type: "checkbox";
default: boolean; default: string;
} }
| { | {
type: "range"; type: "range";