]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts
Support short uuid for GET video/playlist
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-actor-image-edit / actor-avatar-edit.component.ts
index d0d269489e0aa551608c5a95c93009f025c363df..dc9b72ddb48d7e5f4a98c3ef11907bd3986cfe64 100644 (file)
@@ -39,14 +39,13 @@ export class ActorAvatarEditComponent implements OnInit {
   ) { }
 
   ngOnInit (): void {
-    this.serverService.getConfig()
-        .subscribe(config => {
-          this.maxAvatarSize = config.avatar.file.size.max
-          this.avatarExtensions = config.avatar.file.extensions.join(', ')
-
-          this.avatarFormat = `${$localize`max size`}: 192*192px, ` +
-                              `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}`
-        })
+    const config = this.serverService.getHTMLConfig()
+
+    this.maxAvatarSize = config.avatar.file.size.max
+    this.avatarExtensions = config.avatar.file.extensions.join(', ')
+
+    this.avatarFormat = `${$localize`max size`}: 192*192px, ` +
+                        `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}`
   }
 
   onAvatarChange (input: HTMLInputElement) {
@@ -80,4 +79,16 @@ export class ActorAvatarEditComponent implements OnInit {
   isChannel () {
     return !!(this.actor as VideoChannel).ownerAccount
   }
+
+  getChannel (): VideoChannel {
+    if (this.isChannel()) return this.actor as VideoChannel
+
+    return undefined
+  }
+
+  getAccount (): Account {
+    if (this.isChannel()) return undefined
+
+    return this.actor as Account
+  }
 }