Skip to content

Commit 1b8009d

Browse files
deadlyjackAjit Kumar
andauthored
fix(plugin themes not working) (#1504)
Co-authored-by: Ajit Kumar <dellevenjack@gmail>
1 parent a516f1f commit 1b8009d

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/theme/builder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ export default class ThemeBuilder {
283283
.hex.toString();
284284
}
285285

286+
matches(id) {
287+
return this.id.toLowerCase() === id.toLowerCase();
288+
}
289+
286290
/**
287291
* Creates a theme from a CSS string
288292
* @param {string} name

src/theme/list.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ let firstTime = true;
1414

1515
function init() {
1616
themes.forEach((theme) => add(theme));
17-
const { appTheme } = settings.value;
18-
if (appTheme !== "system") {
19-
apply(appTheme);
20-
} else {
21-
updateSystemTheme(isDeviceDarkTheme());
22-
themeApplied = true;
23-
}
2417
}
2518

2619
/**
@@ -68,6 +61,17 @@ function add(theme) {
6861
if (appThemes.has(theme.id)) return;
6962

7063
appThemes.set(theme.id, theme);
64+
65+
const { appTheme } = settings.value;
66+
67+
if (theme.matches(appTheme)) {
68+
if (appTheme !== "system") {
69+
apply(appTheme);
70+
} else {
71+
updateSystemTheme(isDeviceDarkTheme());
72+
themeApplied = true;
73+
}
74+
}
7175
}
7276

7377
/**

0 commit comments

Comments
 (0)