|  | @ -4,6 +4,7 @@ import { | 
			
		
	
		
		
			
				
					|  |  |   KEY_TOKEN, |  |  |   KEY_TOKEN, | 
			
		
	
		
		
			
				
					|  |  |   SettingsStorageService |  |  |   SettingsStorageService | 
			
		
	
		
		
			
				
					|  |  | } from '@ghostfolio/client/services/settings-storage.service'; |  |  | } from '@ghostfolio/client/services/settings-storage.service'; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; | 
			
		
	
		
		
			
				
					|  |  | import { UserService } from '@ghostfolio/client/services/user/user.service'; |  |  | import { UserService } from '@ghostfolio/client/services/user/user.service'; | 
			
		
	
		
		
			
				
					|  |  | import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; |  |  | import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; | 
			
		
	
		
		
			
				
					|  |  | import { downloadAsFile } from '@ghostfolio/common/helper'; |  |  | import { downloadAsFile } from '@ghostfolio/common/helper'; | 
			
		
	
	
		
		
			
				
					|  | @ -17,6 +18,7 @@ import { | 
			
		
	
		
		
			
				
					|  |  |   OnDestroy, |  |  |   OnDestroy, | 
			
		
	
		
		
			
				
					|  |  |   OnInit |  |  |   OnInit | 
			
		
	
		
		
			
				
					|  |  | } from '@angular/core'; |  |  | } from '@angular/core'; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { FormBuilder, Validators } from '@angular/forms'; | 
			
		
	
		
		
			
				
					|  |  | import { MatSlideToggleChange } from '@angular/material/slide-toggle'; |  |  | import { MatSlideToggleChange } from '@angular/material/slide-toggle'; | 
			
		
	
		
		
			
				
					|  |  | import { format, parseISO } from 'date-fns'; |  |  | import { format, parseISO } from 'date-fns'; | 
			
		
	
		
		
			
				
					|  |  | import { uniq } from 'lodash'; |  |  | import { uniq } from 'lodash'; | 
			
		
	
	
		
		
			
				
					|  | @ -33,8 +35,13 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |   public appearancePlaceholder = $localize`Auto`; |  |  |   public appearancePlaceholder = $localize`Auto`; | 
			
		
	
		
		
			
				
					|  |  |   public baseCurrency: string; |  |  |   public baseCurrency: string; | 
			
		
	
		
		
			
				
					|  |  |   public currencies: string[] = []; |  |  |   public currencies: string[] = []; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   public deleteOwnUserForm = this.formBuilder.group({ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     accessToken: ['', Validators.required] | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   public hasPermissionToDeleteOwnUser: boolean; | 
			
		
	
		
		
			
				
					|  |  |   public hasPermissionToUpdateViewMode: boolean; |  |  |   public hasPermissionToUpdateViewMode: boolean; | 
			
		
	
		
		
			
				
					|  |  |   public hasPermissionToUpdateUserSettings: boolean; |  |  |   public hasPermissionToUpdateUserSettings: boolean; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   public isAccessTokenHidden = true; | 
			
		
	
		
		
			
				
					|  |  |   public isWebAuthnEnabled: boolean; |  |  |   public isWebAuthnEnabled: boolean; | 
			
		
	
		
		
			
				
					|  |  |   public language = document.documentElement.lang; |  |  |   public language = document.documentElement.lang; | 
			
		
	
		
		
			
				
					|  |  |   public locales = [ |  |  |   public locales = [ | 
			
		
	
	
		
		
			
				
					|  | @ -58,7 +65,9 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |   public constructor( |  |  |   public constructor( | 
			
		
	
		
		
			
				
					|  |  |     private changeDetectorRef: ChangeDetectorRef, |  |  |     private changeDetectorRef: ChangeDetectorRef, | 
			
		
	
		
		
			
				
					|  |  |     private dataService: DataService, |  |  |     private dataService: DataService, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     private formBuilder: FormBuilder, | 
			
		
	
		
		
			
				
					|  |  |     private settingsStorageService: SettingsStorageService, |  |  |     private settingsStorageService: SettingsStorageService, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     private tokenStorageService: TokenStorageService, | 
			
		
	
		
		
			
				
					|  |  |     private userService: UserService, |  |  |     private userService: UserService, | 
			
		
	
		
		
			
				
					|  |  |     public webAuthnService: WebAuthnService |  |  |     public webAuthnService: WebAuthnService | 
			
		
	
		
		
			
				
					|  |  |   ) { |  |  |   ) { | 
			
		
	
	
		
		
			
				
					|  | @ -73,6 +82,11 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |         if (state?.user) { |  |  |         if (state?.user) { | 
			
		
	
		
		
			
				
					|  |  |           this.user = state.user; |  |  |           this.user = state.user; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           this.hasPermissionToDeleteOwnUser = hasPermission( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             this.user.permissions, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             permissions.deleteOwnUser | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           ); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |           this.hasPermissionToUpdateUserSettings = hasPermission( |  |  |           this.hasPermissionToUpdateUserSettings = hasPermission( | 
			
		
	
		
		
			
				
					|  |  |             this.user.permissions, |  |  |             this.user.permissions, | 
			
		
	
		
		
			
				
					|  |  |             permissions.updateUserSettings |  |  |             permissions.updateUserSettings | 
			
		
	
	
		
		
			
				
					|  | @ -125,6 +139,33 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   public onCloseAccount() { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     const confirmation = confirm( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       $localize`Do you really want to close your Ghostfolio account?` | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     ); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     if (confirmation) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       this.dataService | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         .deleteOwnUser({ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           accessToken: this.deleteOwnUserForm.get('accessToken').value | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         .pipe( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           catchError(() => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             alert($localize`Oops! Incorrect Security Token.`); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             return EMPTY; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           }), | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           takeUntil(this.unsubscribeSubject) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         ) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         .subscribe(() => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           this.tokenStorageService.signOut(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           this.userService.remove(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           document.location.href = `/${document.documentElement.lang}`; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public onExperimentalFeaturesChange(aEvent: MatSlideToggleChange) { |  |  |   public onExperimentalFeaturesChange(aEvent: MatSlideToggleChange) { | 
			
		
	
		
		
			
				
					|  |  |     this.dataService |  |  |     this.dataService | 
			
		
	
		
		
			
				
					|  |  |       .putUserSetting({ isExperimentalFeatures: aEvent.checked }) |  |  |       .putUserSetting({ isExperimentalFeatures: aEvent.checked }) | 
			
		
	
	
		
		
			
				
					|  | 
 |