From 27ec473f5306621643fcb169be7cfe6b15136265 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Apr 2021 12:09:54 +0200 Subject: Set channel banner/avatar in creation form --- client/src/app/shared/shared-main/account/actor.model.ts | 8 ++++---- .../app/shared/shared-main/video-channel/video-channel.model.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared/shared-main') diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index 670823060..1ee0c297e 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts @@ -47,11 +47,11 @@ export abstract class Actor implements ActorServer { return host.trim() === thisHost } - protected constructor (hash: ActorServer) { + protected constructor (hash: Partial) { this.id = hash.id - this.url = hash.url - this.name = hash.name - this.host = hash.host + this.url = hash.url ?? '' + this.name = hash.name ?? '' + this.host = hash.host ?? '' this.followingCount = hash.followingCount this.followersCount = hash.followersCount 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 d8be42eef..1ba3fcc0e 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 @@ -44,7 +44,7 @@ export class VideoChannel extends Actor implements ServerVideoChannel { return `${window.location.origin}/client/assets/images/default-avatar-videochannel.png` } - constructor (hash: ServerVideoChannel) { + constructor (hash: Partial) { super(hash) this.displayName = hash.displayName @@ -93,7 +93,7 @@ export class VideoChannel extends Actor implements ServerVideoChannel { this.updateBanner(null) } - private updateComputedAttributes () { + updateComputedAttributes () { this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this) this.bannerUrl = VideoChannel.GET_ACTOR_BANNER_URL(this) } -- cgit v1.2.3