diff --git a/src/domain/session/settings/SettingsViewModel.js b/src/domain/session/settings/SettingsViewModel.js index eed18953..d844e21b 100644 --- a/src/domain/session/settings/SettingsViewModel.js +++ b/src/domain/session/settings/SettingsViewModel.js @@ -187,9 +187,5 @@ export class SettingsViewModel extends ViewModel { // emit so that radio-buttons become displayed/hidden this.emitChange("themeOption"); } - - get preferredColorScheme() { - return this.platform.themeLoader.preferredColorScheme; - } } diff --git a/src/platform/web/ThemeLoader.ts b/src/platform/web/ThemeLoader.ts index 6a73c565..8c9364bc 100644 --- a/src/platform/web/ThemeLoader.ts +++ b/src/platform/web/ThemeLoader.ts @@ -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!"); } }