From f4f5d16b4ac5ab4970adf69a7f54d4ac6316b908 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 4 Jun 2022 08:18:40 -0700 Subject: [PATCH] rename variable to themeUseSystem from darkModeUseSystem. --- .../frontend/src/@treo/services/config/config.service.ts | 4 ++-- webapp/frontend/src/app/core/config/app.config.ts | 4 ++-- .../dashboard-settings/dashboard-settings.component.html | 6 +++--- .../dashboard-settings/dashboard-settings.component.ts | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/webapp/frontend/src/@treo/services/config/config.service.ts b/webapp/frontend/src/@treo/services/config/config.service.ts index b68bff1..278b506 100644 --- a/webapp/frontend/src/@treo/services/config/config.service.ts +++ b/webapp/frontend/src/@treo/services/config/config.service.ts @@ -52,7 +52,7 @@ export class TreoConfigService //Store the config in localstorage localStorage.setItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config)); - + config.theme = this.determineTheme(config); // Execute the observable @@ -73,7 +73,7 @@ export class TreoConfigService * Checks if theme should be set to dark based on config & system settings */ private determineTheme(config:AppConfig): string { - return (config.darkModeUseSystem && this.systemPrefersDark) ? "dark" : config.theme; + return (config.themeUseSystem && this.systemPrefersDark) ? "dark" : config.theme; } // ----------------------------------------------------------------------------------------------------- diff --git a/webapp/frontend/src/app/core/config/app.config.ts b/webapp/frontend/src/app/core/config/app.config.ts index 913292c..f2ef91b 100644 --- a/webapp/frontend/src/app/core/config/app.config.ts +++ b/webapp/frontend/src/app/core/config/app.config.ts @@ -18,7 +18,7 @@ export interface AppConfig temperatureUnit: string; - darkModeUseSystem: boolean; + themeUseSystem: boolean; } /** @@ -38,6 +38,6 @@ export const appConfig: AppConfig = { temperatureUnit: "celsius", - darkModeUseSystem: true, + themeUseSystem: true, }; diff --git a/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.html b/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.html index 2ef214f..156ce37 100644 --- a/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.html +++ b/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.html @@ -3,10 +3,10 @@
- Use system settings for dark mode -

+ Use system settings for dark mode +

Theme: - + light_mode diff --git a/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.ts b/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.ts index 1efd9e8..37ce10c 100644 --- a/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.ts +++ b/webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.ts @@ -14,7 +14,7 @@ export class DashboardSettingsComponent implements OnInit { dashboardDisplay: string; dashboardSort: string; temperatureUnit: string; - darkModeUseSystem: boolean; + themeUseSystem: boolean; theme: string; // Private @@ -37,11 +37,11 @@ export class DashboardSettingsComponent implements OnInit { this.dashboardDisplay = config.dashboardDisplay; this.dashboardSort = config.dashboardSort; this.temperatureUnit = config.temperatureUnit; - this.darkModeUseSystem = config.darkModeUseSystem; + this.themeUseSystem = config.themeUseSystem; this.theme = config.theme; }); - + } saveSettings(): void { @@ -49,7 +49,7 @@ export class DashboardSettingsComponent implements OnInit { dashboardDisplay: this.dashboardDisplay, dashboardSort: this.dashboardSort, temperatureUnit: this.temperatureUnit, - darkModeUseSystem: this.darkModeUseSystem, + themeUseSystem: this.themeUseSystem, theme: this.theme } this._configService.config = newSettings