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.ts8
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts29
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts17
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts8
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts16
6 files changed, 45 insertions, 42 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 b2b7849c2..08bc5b425 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
@@ -45,8 +45,8 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
45 this.serverService.getConfig(), 45 this.serverService.getConfig(),
46 this.userService.changeEmail(password, email) 46 this.userService.changeEmail(password, email)
47 ]).pipe(tap(() => this.authService.refreshUserInformation())) 47 ]).pipe(tap(() => this.authService.refreshUserInformation()))
48 .subscribe( 48 .subscribe({
49 ([ config ]) => { 49 next: ([ config ]) => {
50 this.form.reset() 50 this.form.reset()
51 51
52 if (config.signup.requiresEmailVerification) { 52 if (config.signup.requiresEmailVerification) {
@@ -56,7 +56,7 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
56 } 56 }
57 }, 57 },
58 58
59 err => { 59 error: err => {
60 if (err.status === 401) { 60 if (err.status === 401) {
61 this.error = $localize`You current password is invalid.` 61 this.error = $localize`You current password is invalid.`
62 return 62 return
@@ -64,6 +64,6 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
64 64
65 this.error = err.message 65 this.error = err.message
66 } 66 }
67 ) 67 })
68 } 68 }
69} 69}
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 e034aedef..f91b2f37b 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
@@ -43,22 +43,23 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
43 const currentPassword = this.form.value[ 'current-password' ] 43 const currentPassword = this.form.value[ 'current-password' ]
44 const newPassword = this.form.value[ 'new-password' ] 44 const newPassword = this.form.value[ 'new-password' ]
45 45
46 this.userService.changePassword(currentPassword, newPassword).subscribe( 46 this.userService.changePassword(currentPassword, newPassword)
47 () => { 47 .subscribe({
48 this.notifier.success($localize`Password updated.`) 48 next: () => {
49 this.notifier.success($localize`Password updated.`)
49 50
50 this.form.reset() 51 this.form.reset()
51 this.error = null 52 this.error = null
52 }, 53 },
53 54
54 err => { 55 error: err => {
55 if (err.status === 401) { 56 if (err.status === 401) {
56 this.error = $localize`You current password is invalid.` 57 this.error = $localize`You current password is invalid.`
57 return 58 return
58 } 59 }
59 60
60 this.error = err.message 61 this.error = err.message
61 } 62 }
62 ) 63 })
63 } 64 }
64} 65}
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 387e9e7cd..5005cb630 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
@@ -27,15 +27,16 @@ export class MyAccountDangerZoneComponent {
27 ) 27 )
28 if (res === false) return 28 if (res === false) return
29 29
30 this.userService.deleteMe().subscribe( 30 this.userService.deleteMe()
31 () => { 31 .subscribe({
32 this.notifier.success($localize`Your account is deleted.`) 32 next: () => {
33 this.notifier.success($localize`Your account is deleted.`)
33 34
34 this.authService.logout() 35 this.authService.logout()
35 this.redirectService.redirectToHomepage() 36 this.redirectService.redirectToHomepage()
36 }, 37 },
37 38
38 err => this.notifier.error(err.message) 39 error: err => this.notifier.error(err.message)
39 ) 40 })
40 } 41 }
41} 42}
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
index b94e6ad82..1eac06234 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
@@ -89,13 +89,13 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
89 89
90 private savePreferencesImpl () { 90 private savePreferencesImpl () {
91 this.userNotificationService.updateNotificationSettings(this.user.notificationSettings) 91 this.userNotificationService.updateNotificationSettings(this.user.notificationSettings)
92 .subscribe( 92 .subscribe({
93 () => { 93 next: () => {
94 this.notifier.success($localize`Preferences saved`, undefined, 2000) 94 this.notifier.success($localize`Preferences saved`, undefined, 2000)
95 }, 95 },
96 96
97 err => this.notifier.error(err.message) 97 error: err => this.notifier.error(err.message)
98 ) 98 })
99 } 99 }
100 100
101 private loadNotificationSettings () { 101 private loadNotificationSettings () {
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
index 80e4446c8..f395ad73f 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
@@ -50,15 +50,16 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
50 50
51 this.error = null 51 this.error = null
52 52
53 this.userService.updateMyProfile({ displayName, description }).subscribe( 53 this.userService.updateMyProfile({ displayName, description })
54 () => { 54 .subscribe({
55 next: () => {
55 this.user.account.displayName = displayName 56 this.user.account.displayName = displayName
56 this.user.account.description = description 57 this.user.account.description = description
57 58
58 this.notifier.success($localize`Profile updated.`) 59 this.notifier.success($localize`Profile updated.`)
59 }, 60 },
60 61
61 err => this.error = err.message 62 error: err => this.error = err.message
62 ) 63 })
63 } 64 }
64} 65}
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 a0f2f28f8..fc7635f38 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
@@ -39,31 +39,31 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
39 39
40 onAvatarChange (formData: FormData) { 40 onAvatarChange (formData: FormData) {
41 this.userService.changeAvatar(formData) 41 this.userService.changeAvatar(formData)
42 .subscribe( 42 .subscribe({
43 data => { 43 next: data => {
44 this.notifier.success($localize`Avatar changed.`) 44 this.notifier.success($localize`Avatar changed.`)
45 45
46 this.user.updateAccountAvatar(data.avatar) 46 this.user.updateAccountAvatar(data.avatar)
47 }, 47 },
48 48
49 (err: HttpErrorResponse) => genericUploadErrorHandler({ 49 error: (err: HttpErrorResponse) => genericUploadErrorHandler({
50 err, 50 err,
51 name: $localize`avatar`, 51 name: $localize`avatar`,
52 notifier: this.notifier 52 notifier: this.notifier
53 }) 53 })
54 ) 54 })
55 } 55 }
56 56
57 onAvatarDelete () { 57 onAvatarDelete () {
58 this.userService.deleteAvatar() 58 this.userService.deleteAvatar()
59 .subscribe( 59 .subscribe({
60 data => { 60 next: data => {
61 this.notifier.success($localize`Avatar deleted.`) 61 this.notifier.success($localize`Avatar deleted.`)
62 62
63 this.user.updateAccountAvatar() 63 this.user.updateAccountAvatar()
64 }, 64 },
65 65
66 (err: HttpErrorResponse) => this.notifier.error(err.message) 66 error: (err: HttpErrorResponse) => this.notifier.error(err.message)
67 ) 67 })
68 } 68 }
69} 69}