Browse Source

Update apps/client/src/app/components/user-account-settings/user-account-settings.component.ts

pull/2483/head
codieai[bot] 2 years ago
committed by GitHub
parent
commit
3ae8b4bfa7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      apps/client/src/app/components/user-account-settings/user-account-settings.component.ts

14
apps/client/src/app/components/user-account-settings/user-account-settings.component.ts

@ -6,7 +6,7 @@ import {
OnInit, OnInit,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
import { import {
STAY_SIGNED_IN, STAY_SIGNED_IN,
@ -30,7 +30,7 @@ import { catchError, takeUntil } from 'rxjs/operators';
}) })
export class UserAccountSettingsComponent implements OnDestroy, OnInit { export class UserAccountSettingsComponent implements OnDestroy, OnInit {
@ViewChild('toggleSignInWithFingerprintEnabledElement') @ViewChild('toggleSignInWithFingerprintEnabledElement')
signInWithFingerprintElement: MatCheckbox; signInWithFingerprintElement: MatSlideToggle;
public appearancePlaceholder = $localize`Auto`; public appearancePlaceholder = $localize`Auto`;
public baseCurrency: string; public baseCurrency: string;
@ -120,7 +120,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
}); });
} }
public onExperimentalFeaturesChange(aEvent: MatCheckboxChange) { public onExperimentalFeaturesChange(aEvent: MatSlideToggleChange) {
this.dataService this.dataService
.putUserSetting({ isExperimentalFeatures: aEvent.checked }) .putUserSetting({ isExperimentalFeatures: aEvent.checked })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
@ -158,7 +158,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
}); });
} }
public onRestrictedViewChange(aEvent: MatCheckboxChange) { public onRestrictedViewChange(aEvent: MatSlideToggleChange) {
this.dataService this.dataService
.putUserSetting({ isRestrictedView: aEvent.checked }) .putUserSetting({ isRestrictedView: aEvent.checked })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
@ -176,7 +176,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
}); });
} }
public onSignInWithFingerprintChange(aEvent: MatCheckboxChange) { public onSignInWithFingerprintChange(aEvent: MatSlideToggleChange) {
if (aEvent.checked) { if (aEvent.checked) {
this.registerDevice(); this.registerDevice();
} else { } else {
@ -192,7 +192,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
} }
} }
public onViewModeChange(aEvent: MatCheckboxChange) { public onViewModeChange(aEvent: MatSlideToggleChange) {
this.dataService this.dataService
.putUserSetting({ viewMode: aEvent.checked === true ? 'ZEN' : 'DEFAULT' }) .putUserSetting({ viewMode: aEvent.checked === true ? 'ZEN' : 'DEFAULT' })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
@ -255,4 +255,4 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
this.webAuthnService.isEnabled() ?? false; this.webAuthnService.isEnabled() ?? false;
} }
} }
} }
Loading…
Cancel
Save