diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-27 11:22:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-27 11:22:21 +0200 |
commit | 87fdea2fbf486f056dd24bfd416841813bd41c58 (patch) | |
tree | 24cc7e153620d792d255d5c441e8bf1609cbe636 /client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | |
parent | e722fb5923ddf11d72e48cec9788abc64327c22f (diff) | |
download | PeerTube-87fdea2fbf486f056dd24bfd416841813bd41c58.tar.gz PeerTube-87fdea2fbf486f056dd24bfd416841813bd41c58.tar.zst PeerTube-87fdea2fbf486f056dd24bfd416841813bd41c58.zip |
Refactor actor avatar component
Diffstat (limited to 'client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts')
-rw-r--r-- | client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | 16 |
1 files changed, 3 insertions, 13 deletions
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 { | |||
75 | return !!this.preview || this.actor.avatars.length !== 0 | 75 | return !!this.preview || this.actor.avatars.length !== 0 |
76 | } | 76 | } |
77 | 77 | ||
78 | isChannel () { | 78 | getActorType () { |
79 | return !!(this.actor as VideoChannel).ownerAccount | 79 | if ((this.actor as VideoChannel).ownerAccount) return 'channel' |
80 | } | ||
81 | |||
82 | getChannel (): VideoChannel { | ||
83 | if (this.isChannel()) return this.actor as VideoChannel | ||
84 | |||
85 | return undefined | ||
86 | } | ||
87 | |||
88 | getAccount (): Account { | ||
89 | if (this.isChannel()) return undefined | ||
90 | 80 | ||
91 | return this.actor as Account | 81 | return 'account' |
92 | } | 82 | } |
93 | } | 83 | } |