X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-actor-image-edit%2Factor-avatar-edit.component.ts;h=fc925083ea4e67555edf899ed394fb1b972bb286;hb=52798aa5f277492d4dd2482bca9396d2e982fa19;hp=01bb401fb644f2b050db5571f914b85a10921988;hpb=ab4b8974997777373a6032073f9c1aaf33ba9931;p=github%2FChocobozzz%2FPeerTube.git 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..fc925083e 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 @@ -1,7 +1,6 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' import { Notifier, ServerService } from '@app/core' import { Account, VideoChannel } from '@app/shared/shared-main' -import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' import { getBytes } from '@root-helpers/bytes' import { imageToDataURL } from '@root-helpers/images' @@ -15,7 +14,6 @@ import { imageToDataURL } from '@root-helpers/images' }) export class ActorAvatarEditComponent implements OnInit { @ViewChild('avatarfileInput') avatarfileInput: ElementRef - @ViewChild('avatarPopover') avatarPopover: NgbPopover @Input() actor: VideoChannel | Account @Input() editable = true @@ -58,7 +56,6 @@ export class ActorAvatarEditComponent implements OnInit { const formData = new FormData() formData.append('avatarfile', avatarfile) - this.avatarPopover?.close() this.avatarChange.emit(formData) if (this.previewImage) { @@ -75,19 +72,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' } }