diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/+my-account | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/+my-account')
7 files changed, 58 insertions, 59 deletions
diff --git a/client/src/app/+my-account/my-account-applications/my-account-applications.component.ts b/client/src/app/+my-account/my-account-applications/my-account-applications.component.ts index 5e9525fbb..6873c7d40 100644 --- a/client/src/app/+my-account/my-account-applications/my-account-applications.component.ts +++ b/client/src/app/+my-account/my-account-applications/my-account-applications.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, Notifier, ConfirmService, ScopedTokensService } from '@app/core' | 2 | import { AuthService, ConfirmService, Notifier, ScopedTokensService } from '@app/core' |
3 | import { VideoService } from '@app/shared/shared-main' | 3 | import { VideoService } from '@app/shared/shared-main' |
4 | import { FeedFormat } from '@shared/models' | 4 | import { FeedFormat } from '@shared/models' |
5 | import { ScopedToken } from '@shared/models/users/user-scoped-token' | 5 | import { ScopedToken } from '@shared/models/users/user-scoped-token' |
@@ -27,13 +27,11 @@ export class MyAccountApplicationsComponent implements OnInit { | |||
27 | ngOnInit () { | 27 | ngOnInit () { |
28 | this.feedUrl = this.baseURL | 28 | this.feedUrl = this.baseURL |
29 | this.scopedTokensService.getScopedTokens() | 29 | this.scopedTokensService.getScopedTokens() |
30 | .subscribe( | 30 | .subscribe({ |
31 | tokens => this.regenApplications(tokens), | 31 | next: tokens => this.regenApplications(tokens), |
32 | 32 | ||
33 | err => { | 33 | error: err => this.notifier.error(err.message) |
34 | this.notifier.error(err.message) | 34 | }) |
35 | } | ||
36 | ) | ||
37 | } | 35 | } |
38 | 36 | ||
39 | async renewToken () { | 37 | async renewToken () { |
@@ -43,17 +41,15 @@ export class MyAccountApplicationsComponent implements OnInit { | |||
43 | ) | 41 | ) |
44 | if (res === false) return | 42 | if (res === false) return |
45 | 43 | ||
46 | this.scopedTokensService.renewScopedTokens().subscribe( | 44 | this.scopedTokensService.renewScopedTokens() |
47 | tokens => { | 45 | .subscribe({ |
48 | this.regenApplications(tokens) | 46 | next: tokens => { |
49 | this.notifier.success($localize`Token renewed. Update your client configuration accordingly.`) | 47 | this.regenApplications(tokens) |
50 | }, | 48 | this.notifier.success($localize`Token renewed. Update your client configuration accordingly.`) |
51 | 49 | }, | |
52 | err => { | ||
53 | this.notifier.error(err.message) | ||
54 | } | ||
55 | ) | ||
56 | 50 | ||
51 | error: err => this.notifier.error(err.message) | ||
52 | }) | ||
57 | } | 53 | } |
58 | 54 | ||
59 | private regenApplications (tokens: ScopedToken) { | 55 | private regenApplications (tokens: ScopedToken) { |
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 | } |