diff --git a/CHANGELOG.md b/CHANGELOG.md index 60bc42116..22963bb22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Changed the view mode selector to a slide toggle - Upgraded `Nx` from version `15.0.0` to `15.0.13` ## 1.211.0 - 11.11.2022 diff --git a/apps/client/src/app/pages/account/account-page.component.ts b/apps/client/src/app/pages/account/account-page.component.ts index aa43b50ac..2dc757397 100644 --- a/apps/client/src/app/pages/account/account-page.component.ts +++ b/apps/client/src/app/pages/account/account-page.component.ts @@ -303,6 +303,24 @@ export class AccountPageComponent implements OnDestroy, OnInit { } } + public onViewModeChange(aEvent: MatSlideToggleChange) { + this.dataService + .putUserSetting({ viewMode: aEvent.checked === true ? 'ZEN' : 'DEFAULT' }) + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe(() => { + this.userService.remove(); + + this.userService + .get() + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe((user) => { + this.user = user; + + this.changeDetectorRef.markForCheck(); + }); + }); + } + public ngOnDestroy() { this.unsubscribeSubject.next(); this.unsubscribeSubject.complete(); diff --git a/apps/client/src/app/pages/account/account-page.html b/apps/client/src/app/pages/account/account-page.html index 66ec08189..08e580a7a 100644 --- a/apps/client/src/app/pages/account/account-page.html +++ b/apps/client/src/app/pages/account/account-page.html @@ -167,29 +167,6 @@ -