aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video-channel
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-13 09:12:55 +0100
committerGitHub <noreply@github.com>2021-01-13 09:12:55 +0100
commit1ea7da819e5bfae7b443ed722c18c4165d101439 (patch)
tree17cea3786dfb3a59a2ad5559de9ebf106a0440a2 /client/src/app/shared/shared-main/video-channel
parent75dd1b641f987e1e09dbaa3329e08c6e98a858f3 (diff)
downloadPeerTube-1ea7da819e5bfae7b443ed722c18c4165d101439.tar.gz
PeerTube-1ea7da819e5bfae7b443ed722c18c4165d101439.tar.zst
PeerTube-1ea7da819e5bfae7b443ed722c18c4165d101439.zip
add ability to remove one's avatar for account and channels (#3467)
* add ability to remove one's avatar for account and channels * add ability to remove one's avatar for account and channels * only display avatar edition options after input change
Diffstat (limited to 'client/src/app/shared/shared-main/video-channel')
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.model.ts5
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.service.ts10
2 files changed, 15 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
index 4f1f5b65d..c6a63fe6c 100644
--- a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
@@ -56,6 +56,11 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
56 this.updateComputedAttributes() 56 this.updateComputedAttributes()
57 } 57 }
58 58
59 resetAvatar () {
60 this.avatar = null
61 this.avatarUrl = VideoChannel.GET_DEFAULT_AVATAR_URL()
62 }
63
59 private updateComputedAttributes () { 64 private updateComputedAttributes () {
60 this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this) 65 this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this)
61 } 66 }
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
index 64dcf638a..eff3fad4d 100644
--- a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
@@ -89,6 +89,16 @@ export class VideoChannelService {
89 .pipe(catchError(err => this.restExtractor.handleError(err))) 89 .pipe(catchError(err => this.restExtractor.handleError(err)))
90 } 90 }
91 91
92 deleteVideoChannelAvatar (videoChannelName: string) {
93 const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName + '/avatar'
94
95 return this.authHttp.delete(url)
96 .pipe(
97 map(this.restExtractor.extractDataBool),
98 catchError(err => this.restExtractor.handleError(err))
99 )
100 }
101
92 removeVideoChannel (videoChannel: VideoChannel) { 102 removeVideoChannel (videoChannel: VideoChannel) {
93 return this.authHttp.delete(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.nameWithHost) 103 return this.authHttp.delete(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.nameWithHost)
94 .pipe( 104 .pipe(