Fix theme (#697)
* fix theme * fix theme Co-authored-by: rohandebsarkar <rohandebsarkar@gmail.com>
This commit is contained in:
parent
f7274c0dab
commit
4e460ee494
@ -50,12 +50,13 @@ let transTheme = () => {
|
|||||||
|
|
||||||
|
|
||||||
let initTheme = (theme) => {
|
let initTheme = (theme) => {
|
||||||
if (theme == null) {
|
if (theme == null || theme == 'null') {
|
||||||
const userPref = window.matchMedia;
|
const userPref = window.matchMedia;
|
||||||
if (userPref && userPref('(prefers-color-scheme: dark)').matches) {
|
if (userPref && userPref('(prefers-color-scheme: dark)').matches) {
|
||||||
theme = 'dark';
|
theme = 'dark';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user