From 3cf60f8daacf294db6aa1b256ccabb4d245fb0db Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Sun, 14 Jan 2024 16:11:26 +0000 Subject: [PATCH] fix: broken checkbox default parsing --- src/components/ThemeSettings/ThemesTab.tsx | 4 +--- src/utils/themes/usercss/usercss-meta.d.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/ThemeSettings/ThemesTab.tsx b/src/components/ThemeSettings/ThemesTab.tsx index 50ab15d0a..e9440e4fc 100644 --- a/src/components/ThemeSettings/ThemesTab.tsx +++ b/src/components/ThemeSettings/ThemesTab.tsx @@ -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; diff --git a/src/utils/themes/usercss/usercss-meta.d.ts b/src/utils/themes/usercss/usercss-meta.d.ts index f4d29e631..56bacd435 100644 --- a/src/utils/themes/usercss/usercss-meta.d.ts +++ b/src/utils/themes/usercss/usercss-meta.d.ts @@ -19,7 +19,7 @@ declare module "usercss-meta" { } | { type: "checkbox"; - default: boolean; + default: string; } | { type: "range";