aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-library
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-library')
-rw-r--r--client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html2
-rw-r--r--client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts1
-rw-r--r--client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts21
3 files changed, 22 insertions, 2 deletions
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html b/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html
index 5ea000400..735f9e3ba 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html
@@ -46,7 +46,7 @@
46 46
47 <my-actor-avatar-info 47 <my-actor-avatar-info
48 *ngIf="!isCreation() && videoChannelToUpdate" 48 *ngIf="!isCreation() && videoChannelToUpdate"
49 [actor]="videoChannelToUpdate" (avatarChange)="onAvatarChange($event)" 49 [actor]="videoChannelToUpdate" (avatarChange)="onAvatarChange($event)" (avatarDelete)="onAvatarDelete()"
50 ></my-actor-avatar-info> 50 ></my-actor-avatar-info>
51 51
52 <div class="form-group"> 52 <div class="form-group">
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts
index 09db0df9d..3e20a27ee 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts
@@ -14,6 +14,7 @@ export abstract class MyVideoChannelEdit extends FormReactive {
14 14
15 // We need this method so angular does not complain in child template that doesn't need this 15 // We need this method so angular does not complain in child template that doesn't need this
16 onAvatarChange (formData: FormData) { /* empty */ } 16 onAvatarChange (formData: FormData) { /* empty */ }
17 onAvatarDelete () { /* empty */ }
17 18
18 // Should be implemented by the child 19 // Should be implemented by the child
19 isBulkUpdateVideosDisplayed () { 20 isBulkUpdateVideosDisplayed () {
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 c6cb5ade6..6cd1ff503 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
@@ -11,6 +11,8 @@ import { FormValidatorService } from '@app/shared/shared-forms'
11import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' 11import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
12import { ServerConfig, VideoChannelUpdate } from '@shared/models' 12import { ServerConfig, VideoChannelUpdate } from '@shared/models'
13import { MyVideoChannelEdit } from './my-video-channel-edit' 13import { MyVideoChannelEdit } from './my-video-channel-edit'
14import { HttpErrorResponse } from '@angular/common/http'
15import { uploadErrorHandler } from '@app/helpers'
14 16
15@Component({ 17@Component({
16 selector: 'my-video-channel-update', 18 selector: 'my-video-channel-update',
@@ -107,10 +109,27 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements
107 this.videoChannelToUpdate.updateAvatar(data.avatar) 109 this.videoChannelToUpdate.updateAvatar(data.avatar)
108 }, 110 },
109 111
110 err => this.notifier.error(err.message) 112 (err: HttpErrorResponse) => uploadErrorHandler({
113 err,
114 name: $localize`avatar`,
115 notifier: this.notifier
116 })
111 ) 117 )
112 } 118 }
113 119
120 onAvatarDelete () {
121 this.videoChannelService.deleteVideoChannelAvatar(this.videoChannelToUpdate.name)
122 .subscribe(
123 data => {
124 this.notifier.success($localize`Avatar deleted.`)
125
126 this.videoChannelToUpdate.resetAvatar()
127 },
128
129 err => this.notifier.error(err.message)
130 )
131 }
132
114 get maxAvatarSize () { 133 get maxAvatarSize () {
115 return this.serverConfig.avatar.file.size.max 134 return this.serverConfig.avatar.file.size.max
116 } 135 }