From 87fdea2fbf486f056dd24bfd416841813bd41c58 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Jun 2022 11:22:21 +0200 Subject: Refactor actor avatar component --- .../actor-avatar-edit.component.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts') diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts index 01bb401fb..b71a3c485 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts +++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts @@ -75,19 +75,9 @@ export class ActorAvatarEditComponent implements OnInit { return !!this.preview || this.actor.avatars.length !== 0 } - 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 + getActorType () { + if ((this.actor as VideoChannel).ownerAccount) return 'channel' - return this.actor as Account + return 'account' } } -- cgit v1.2.3