aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-settings')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts6
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts14
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts3
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts2
4 files changed, 15 insertions, 10 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
index 08bc5b425..9b87daa40 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
@@ -28,7 +28,7 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
28 ngOnInit () { 28 ngOnInit () {
29 this.buildForm({ 29 this.buildForm({
30 'new-email': USER_EMAIL_VALIDATOR, 30 'new-email': USER_EMAIL_VALIDATOR,
31 'password': USER_PASSWORD_VALIDATOR 31 password: USER_PASSWORD_VALIDATOR
32 }) 32 })
33 33
34 this.user = this.authService.getUser() 34 this.user = this.authService.getUser()
@@ -38,8 +38,8 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
38 this.error = null 38 this.error = null
39 this.success = null 39 this.success = null
40 40
41 const password = this.form.value[ 'password' ] 41 const password = this.form.value['password']
42 const email = this.form.value[ 'new-email' ] 42 const email = this.form.value['new-email']
43 43
44 forkJoin([ 44 forkJoin([
45 this.serverService.getConfig(), 45 this.serverService.getConfig(),
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
index f91b2f37b..47e54dc23 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
@@ -1,7 +1,11 @@
1import { filter } from 'rxjs/operators' 1import { filter } from 'rxjs/operators'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { AuthService, Notifier, UserService } from '@app/core' 3import { AuthService, Notifier, UserService } from '@app/core'
4import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR, USER_EXISTING_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' 4import {
5 USER_CONFIRM_PASSWORD_VALIDATOR,
6 USER_EXISTING_PASSWORD_VALIDATOR,
7 USER_PASSWORD_VALIDATOR
8} from '@app/shared/form-validators/user-validators'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 9import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { User } from '@shared/models' 10import { User } from '@shared/models'
7 11
@@ -19,7 +23,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
19 private notifier: Notifier, 23 private notifier: Notifier,
20 private authService: AuthService, 24 private authService: AuthService,
21 private userService: UserService 25 private userService: UserService
22 ) { 26 ) {
23 super() 27 super()
24 } 28 }
25 29
@@ -35,13 +39,13 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
35 const confirmPasswordControl = this.form.get('new-confirmed-password') 39 const confirmPasswordControl = this.form.get('new-confirmed-password')
36 40
37 confirmPasswordControl.valueChanges 41 confirmPasswordControl.valueChanges
38 .pipe(filter(v => v !== this.form.value[ 'new-password' ])) 42 .pipe(filter(v => v !== this.form.value['new-password']))
39 .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true })) 43 .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true }))
40 } 44 }
41 45
42 changePassword () { 46 changePassword () {
43 const currentPassword = this.form.value[ 'current-password' ] 47 const currentPassword = this.form.value['current-password']
44 const newPassword = this.form.value[ 'new-password' ] 48 const newPassword = this.form.value['new-password']
45 49
46 this.userService.changePassword(currentPassword, newPassword) 50 this.userService.changePassword(currentPassword, newPassword)
47 .subscribe({ 51 .subscribe({
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
index 5005cb630..4a46f1ad9 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
@@ -15,10 +15,11 @@ export class MyAccountDangerZoneComponent {
15 private userService: UserService, 15 private userService: UserService,
16 private confirmService: ConfirmService, 16 private confirmService: ConfirmService,
17 private redirectService: RedirectService 17 private redirectService: RedirectService
18 ) { } 18 ) { }
19 19
20 async deleteMe () { 20 async deleteMe () {
21 const res = await this.confirmService.confirmWithInput( 21 const res = await this.confirmService.confirmWithInput(
22 // eslint-disable-next-line max-len
22 $localize`Are you sure you want to delete your account? This will delete all your data, including channels, videos and comments. Content cached by other servers and other third-parties might make longer to be deleted.`, 23 $localize`Are you sure you want to delete your account? This will delete all your data, including channels, videos and comments. Content cached by other servers and other third-parties might make longer to be deleted.`,
23 $localize`Type your username to confirm`, 24 $localize`Type your username to confirm`,
24 this.user.username, 25 this.user.username,
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
index fc7635f38..a5bcb6496 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
@@ -19,7 +19,7 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
19 private userService: UserService, 19 private userService: UserService,
20 private authService: AuthService, 20 private authService: AuthService,
21 private notifier: Notifier 21 private notifier: Notifier
22 ) {} 22 ) {}
23 23
24 get userInformationLoaded () { 24 get userInformationLoaded () {
25 return this.authService.userInformationLoaded 25 return this.authService.userInformationLoaded