From 0085c8351e75b0f0c88e27c563c88d1601ec903b Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:40:04 -0800 Subject: [PATCH] Prevent overriding other settings --- .../manage/settings/settings.component.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts index 376192bd3..31fc9d88a 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.ts +++ b/src-ui/src/app/components/manage/settings/settings.component.ts @@ -101,21 +101,14 @@ export class SettingsComponent implements OnInit, OnDestroy, DirtyComponent { // Initialize dirtyCheck this.isDirty$ = dirtyCheck(this.settingsForm, this.store.asObservable()) + // Record dirty in case we need to 'undo' appearance settings if not saved on close this.isDirty$.subscribe(dirty => { this.isDirty = dirty }) // "Live" visual changes prior to save - this.settingsForm.get('darkModeUseSystem').valueChanges.subscribe(darkModeUseSystem => { - this.settings.updateAppearanceSettings(darkModeUseSystem, this.settingsForm.get('darkModeEnabled').value) - }) - - this.settingsForm.get('darkModeEnabled').valueChanges.subscribe(darkModeEnabled => { - this.settings.updateAppearanceSettings(this.settingsForm.get('darkModeEnabled').value, darkModeEnabled) - }) - - this.settingsForm.get('themeColor').valueChanges.subscribe(color => { - this.settings.updateAppearanceSettings(null, null, color) + this.settingsForm.valueChanges.subscribe(() => { + this.settings.updateAppearanceSettings(this.settingsForm.get('darkModeEnabled').value, this.settingsForm.get('darkModeEnabled').value, this.settingsForm.get('themeColor').value) }) }) }