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-library/+my-video-channels | |
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-library/+my-video-channels')
3 files changed, 48 insertions, 46 deletions
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts index 433475f66..d983aacd9 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts | |||
@@ -59,15 +59,15 @@ export class MyVideoChannelCreateComponent extends MyVideoChannelEdit implements | |||
59 | .pipe( | 59 | .pipe( |
60 | switchMap(() => this.uploadAvatar()), | 60 | switchMap(() => this.uploadAvatar()), |
61 | switchMap(() => this.uploadBanner()) | 61 | switchMap(() => this.uploadBanner()) |
62 | ).subscribe( | 62 | ).subscribe({ |
63 | () => { | 63 | next: () => { |
64 | this.authService.refreshUserInformation() | 64 | this.authService.refreshUserInformation() |
65 | 65 | ||
66 | this.notifier.success($localize`Video channel ${videoChannelCreate.displayName} created.`) | 66 | this.notifier.success($localize`Video channel ${videoChannelCreate.displayName} created.`) |
67 | this.router.navigate(['/my-library', 'video-channels']) | 67 | this.router.navigate(['/my-library', 'video-channels']) |
68 | }, | 68 | }, |
69 | 69 | ||
70 | err => { | 70 | error: err => { |
71 | if (err.status === HttpStatusCode.CONFLICT_409) { | 71 | if (err.status === HttpStatusCode.CONFLICT_409) { |
72 | this.error = $localize`This name already exists on this instance.` | 72 | this.error = $localize`This name already exists on this instance.` |
73 | return | 73 | return |
@@ -75,7 +75,7 @@ export class MyVideoChannelCreateComponent extends MyVideoChannelEdit implements | |||
75 | 75 | ||
76 | this.error = err.message | 76 | this.error = err.message |
77 | } | 77 | } |
78 | ) | 78 | }) |
79 | } | 79 | } |
80 | 80 | ||
81 | onAvatarChange (formData: FormData) { | 81 | onAvatarChange (formData: FormData) { |
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts index eb24a60c5..e8bfbf9ce 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts | |||
@@ -52,21 +52,22 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements | |||
52 | this.paramsSub = this.route.params.subscribe(routeParams => { | 52 | this.paramsSub = this.route.params.subscribe(routeParams => { |
53 | const videoChannelId = routeParams['videoChannelId'] | 53 | const videoChannelId = routeParams['videoChannelId'] |
54 | 54 | ||
55 | this.videoChannelService.getVideoChannel(videoChannelId).subscribe( | 55 | this.videoChannelService.getVideoChannel(videoChannelId) |
56 | videoChannelToUpdate => { | 56 | .subscribe({ |
57 | this.videoChannel = videoChannelToUpdate | 57 | next: videoChannelToUpdate => { |
58 | 58 | this.videoChannel = videoChannelToUpdate | |
59 | this.oldSupportField = videoChannelToUpdate.support | 59 | |
60 | 60 | this.oldSupportField = videoChannelToUpdate.support | |
61 | this.form.patchValue({ | 61 | |
62 | 'display-name': videoChannelToUpdate.displayName, | 62 | this.form.patchValue({ |
63 | description: videoChannelToUpdate.description, | 63 | 'display-name': videoChannelToUpdate.displayName, |
64 | support: videoChannelToUpdate.support | 64 | description: videoChannelToUpdate.description, |
65 | }) | 65 | support: videoChannelToUpdate.support |
66 | }, | 66 | }) |
67 | }, | ||
67 | 68 | ||
68 | err => this.error = err.message | 69 | error: err => this.error = err.message |
69 | ) | 70 | }) |
70 | }) | 71 | }) |
71 | } | 72 | } |
72 | 73 | ||
@@ -85,77 +86,78 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements | |||
85 | bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false | 86 | bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false |
86 | } | 87 | } |
87 | 88 | ||
88 | this.videoChannelService.updateVideoChannel(this.videoChannel.name, videoChannelUpdate).subscribe( | 89 | this.videoChannelService.updateVideoChannel(this.videoChannel.name, videoChannelUpdate) |
89 | () => { | 90 | .subscribe({ |
90 | this.authService.refreshUserInformation() | 91 | next: () => { |
92 | this.authService.refreshUserInformation() | ||
91 | 93 | ||
92 | this.notifier.success($localize`Video channel ${videoChannelUpdate.displayName} updated.`) | 94 | this.notifier.success($localize`Video channel ${videoChannelUpdate.displayName} updated.`) |
93 | 95 | ||
94 | this.router.navigate([ '/my-library', 'video-channels' ]) | 96 | this.router.navigate([ '/my-library', 'video-channels' ]) |
95 | }, | 97 | }, |
96 | 98 | ||
97 | err => this.error = err.message | 99 | error: err => this.error = err.message |
98 | ) | 100 | }) |
99 | } | 101 | } |
100 | 102 | ||
101 | onAvatarChange (formData: FormData) { | 103 | onAvatarChange (formData: FormData) { |
102 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'avatar') | 104 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'avatar') |
103 | .subscribe( | 105 | .subscribe({ |
104 | data => { | 106 | next: data => { |
105 | this.notifier.success($localize`Avatar changed.`) | 107 | this.notifier.success($localize`Avatar changed.`) |
106 | 108 | ||
107 | this.videoChannel.updateAvatar(data.avatar) | 109 | this.videoChannel.updateAvatar(data.avatar) |
108 | }, | 110 | }, |
109 | 111 | ||
110 | (err: HttpErrorResponse) => genericUploadErrorHandler({ | 112 | error: (err: HttpErrorResponse) => genericUploadErrorHandler({ |
111 | err, | 113 | err, |
112 | name: $localize`avatar`, | 114 | name: $localize`avatar`, |
113 | notifier: this.notifier | 115 | notifier: this.notifier |
114 | }) | 116 | }) |
115 | ) | 117 | }) |
116 | } | 118 | } |
117 | 119 | ||
118 | onAvatarDelete () { | 120 | onAvatarDelete () { |
119 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'avatar') | 121 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'avatar') |
120 | .subscribe( | 122 | .subscribe({ |
121 | data => { | 123 | next: () => { |
122 | this.notifier.success($localize`Avatar deleted.`) | 124 | this.notifier.success($localize`Avatar deleted.`) |
123 | 125 | ||
124 | this.videoChannel.resetAvatar() | 126 | this.videoChannel.resetAvatar() |
125 | }, | 127 | }, |
126 | 128 | ||
127 | err => this.notifier.error(err.message) | 129 | error: err => this.notifier.error(err.message) |
128 | ) | 130 | }) |
129 | } | 131 | } |
130 | 132 | ||
131 | onBannerChange (formData: FormData) { | 133 | onBannerChange (formData: FormData) { |
132 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'banner') | 134 | this.videoChannelService.changeVideoChannelImage(this.videoChannel.name, formData, 'banner') |
133 | .subscribe( | 135 | .subscribe({ |
134 | data => { | 136 | next: data => { |
135 | this.notifier.success($localize`Banner changed.`) | 137 | this.notifier.success($localize`Banner changed.`) |
136 | 138 | ||
137 | this.videoChannel.updateBanner(data.banner) | 139 | this.videoChannel.updateBanner(data.banner) |
138 | }, | 140 | }, |
139 | 141 | ||
140 | (err: HttpErrorResponse) => genericUploadErrorHandler({ | 142 | error: (err: HttpErrorResponse) => genericUploadErrorHandler({ |
141 | err, | 143 | err, |
142 | name: $localize`banner`, | 144 | name: $localize`banner`, |
143 | notifier: this.notifier | 145 | notifier: this.notifier |
144 | }) | 146 | }) |
145 | ) | 147 | }) |
146 | } | 148 | } |
147 | 149 | ||
148 | onBannerDelete () { | 150 | onBannerDelete () { |
149 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'banner') | 151 | this.videoChannelService.deleteVideoChannelImage(this.videoChannel.name, 'banner') |
150 | .subscribe( | 152 | .subscribe({ |
151 | data => { | 153 | next: () => { |
152 | this.notifier.success($localize`Banner deleted.`) | 154 | this.notifier.success($localize`Banner deleted.`) |
153 | 155 | ||
154 | this.videoChannel.resetBanner() | 156 | this.videoChannel.resetBanner() |
155 | }, | 157 | }, |
156 | 158 | ||
157 | err => this.notifier.error(err.message) | 159 | error: err => this.notifier.error(err.message) |
158 | ) | 160 | }) |
159 | } | 161 | } |
160 | 162 | ||
161 | get maxAvatarSize () { | 163 | get maxAvatarSize () { |
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts index b6a2f592d..8b665fd58 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts | |||
@@ -54,14 +54,14 @@ channel with the same name (${videoChannel.name})!`, | |||
54 | if (res === false) return | 54 | if (res === false) return |
55 | 55 | ||
56 | this.videoChannelService.removeVideoChannel(videoChannel) | 56 | this.videoChannelService.removeVideoChannel(videoChannel) |
57 | .subscribe( | 57 | .subscribe({ |
58 | () => { | 58 | next: () => { |
59 | this.loadVideoChannels() | 59 | this.loadVideoChannels() |
60 | this.notifier.success($localize`Video channel ${videoChannel.displayName} deleted.`) | 60 | this.notifier.success($localize`Video channel ${videoChannel.displayName} deleted.`) |
61 | }, | 61 | }, |
62 | 62 | ||
63 | error => this.notifier.error(error.message) | 63 | error: err => this.notifier.error(err.message) |
64 | ) | 64 | }) |
65 | } | 65 | } |
66 | 66 | ||
67 | private loadVideoChannels () { | 67 | private loadVideoChannels () { |