handle auto theme correctly with the manual toggle

If the user used the manual toggle, they will not be able to get back to
auto since it will force set to light theme. This should fix that.
This commit is contained in:
shironeko 2022-12-29 14:41:17 -05:00
parent 5160d8bae3
commit 1aaf290814
1 changed files with 3 additions and 1 deletions

View File

@ -22,9 +22,11 @@ function setTheme(theme) {
if (theme === THEME_DARK) { if (theme === THEME_DARK) {
toggle_theme.children[0].className = 'icon ion-ios-sunny'; toggle_theme.children[0].className = 'icon ion-ios-sunny';
document.body.className = 'dark-theme'; document.body.className = 'dark-theme';
} else { } else if (theme === THEME_LIGHT) {
toggle_theme.children[0].className = 'icon ion-ios-moon'; toggle_theme.children[0].className = 'icon ion-ios-moon';
document.body.className = 'light-theme'; document.body.className = 'light-theme';
} else {
document.body.className = 'no-theme';
} }
} }