summaryrefslogtreecommitdiff
path: root/site/themes
diff options
context:
space:
mode:
Diffstat (limited to 'site/themes')
-rw-r--r--site/themes/sine/static/js/switch-theme.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/site/themes/sine/static/js/switch-theme.js b/site/themes/sine/static/js/switch-theme.js
index 8baaee5..433ace1 100644
--- a/site/themes/sine/static/js/switch-theme.js
+++ b/site/themes/sine/static/js/switch-theme.js
@@ -17,7 +17,7 @@ const defaultLightTheme = "melatonin-light";
// checks whether there is already a theme and if not, sets it to the user's default theme.
function calculateTheme({ localStorageTheme, systemSettingDark }) {
- if (localStorageTheme !== null) {
+ if (localStorageTheme !== null && themeOrder.includes(localStorageTheme)) {
return localStorageTheme;
}
@@ -58,7 +58,6 @@ const systemSettingDark = window.matchMedia("(prefers-color-scheme: dark)");
// 2. Work out the current site settings
let currentTheme = calculateTheme({ localStorageTheme, systemSettingDark });
-console.log(currentTheme)
// 3. Update the theme setting and button text accoridng to current settings
updateButton( button, currentTheme);
@@ -72,7 +71,8 @@ button.addEventListener("click", (event) => {
updateButton( button, newTheme);
applyTheme( newTheme );
+ // console.log(themeOrder)
+
currentTheme = newTheme;
- console.log(currentTheme)
});