Skip to content

Commit

Permalink
Fix theme (daattali#697)
Browse files Browse the repository at this point in the history
* fix theme

* fix theme

Co-authored-by: rohandebsarkar <rohandebsarkar@gmail.com>
  • Loading branch information
rohandebsarkar and rohandebsarkar authored Jun 8, 2022
1 parent f7274c0 commit 4e460ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ let transTheme = () => {


let initTheme = (theme) => {
if (theme == null) {
if (theme == null || theme == 'null') {
const userPref = window.matchMedia;
if (userPref && userPref('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
}
}

setTheme(theme);
}

Expand Down

0 comments on commit 4e460ee

Please sign in to comment.