aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2023-03-09 12:24:43 +0100
committerMiodec <[email protected]>2023-03-09 12:24:43 +0100
commit6ad52aa34749b3e3a3ccbe7f6a32cc83b64bf4ad (patch)
treeca0113fc536caff2b0c627bdaa70fcaee2be4610
parenta619c0410b9c1ae7ef5e98a96186501d1fc2ba41 (diff)
downloadmonkeytype-6ad52aa34749b3e3a3ccbe7f6a32cc83b64bf4ad.tar.gz
monkeytype-6ad52aa34749b3e3a3ccbe7f6a32cc83b64bf4ad.zip
fixed custom theme colors being saved in the wrong order
-rw-r--r--frontend/src/ts/settings/theme-picker.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/frontend/src/ts/settings/theme-picker.ts b/frontend/src/ts/settings/theme-picker.ts
index 0ce28cc35..1247eb596 100644
--- a/frontend/src/ts/settings/theme-picker.ts
+++ b/frontend/src/ts/settings/theme-picker.ts
@@ -280,12 +280,13 @@ function toggleFavourite(themeName: string): void {
export function saveCustomThemeColors(): void {
const newColors: string[] = [];
- $.each(
- $(".pageSettings .customTheme .customThemeEdit [type='color']"),
- (_index, element) => {
- newColors.push($(element).attr("value") as string);
- }
- );
+ for (const color of ThemeController.colorVars) {
+ newColors.push(
+ $(
+ `.pageSettings .customTheme .customThemeEdit #${color}[type='color']`
+ ).attr("value") as string
+ );
+ }
UpdateConfig.setCustomThemeColors(newColors);
Notifications.add("Custom theme saved", 1);
}