mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-01 23:21:40 +01:00
No need to throw here
This commit is contained in:
parent
69d8e6031e
commit
d00ea39dc4
@ -196,13 +196,12 @@ export class ThemeLoader {
|
||||
}
|
||||
}
|
||||
|
||||
get preferredColorScheme(): ColorSchemePreference {
|
||||
get preferredColorScheme(): ColorSchemePreference | undefined {
|
||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||
return ColorSchemePreference.Dark;
|
||||
}
|
||||
else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
|
||||
return ColorSchemePreference.Light;
|
||||
}
|
||||
throw new Error("Cannot find preferred colorscheme!");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user