forked from mystiq/hydrogen-web
No need to throw here
This commit is contained in:
parent
69d8e6031e
commit
d00ea39dc4
1 changed files with 1 additions and 2 deletions
|
@ -196,13 +196,12 @@ export class ThemeLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get preferredColorScheme(): ColorSchemePreference {
|
get preferredColorScheme(): ColorSchemePreference | undefined {
|
||||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||||
return ColorSchemePreference.Dark;
|
return ColorSchemePreference.Dark;
|
||||||
}
|
}
|
||||||
else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
|
else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
|
||||||
return ColorSchemePreference.Light;
|
return ColorSchemePreference.Light;
|
||||||
}
|
}
|
||||||
throw new Error("Cannot find preferred colorscheme!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue