]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/shared/actor-avatar-info.component.ts
Refractor notification service
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / shared / actor-avatar-info.component.ts
index e0b25ad33394d7acdf72d70361b72ad23eff4810..72c815a0c7778c265b4a1ff548cdb403ebbf49b1 100644 (file)
@@ -1,10 +1,8 @@
-import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'
-import { AuthService } from '../../core'
+import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core'
 import { ServerService } from '../../core/server'
-import { UserService } from '../../shared/users'
-import { NotificationsService } from 'angular2-notifications'
 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
 import { Account } from '@app/shared/account/account.model'
+import { Notifier } from '@app/core'
 
 @Component({
   selector: 'my-actor-avatar-info',
@@ -12,23 +10,21 @@ import { Account } from '@app/shared/account/account.model'
   styleUrls: [ './actor-avatar-info.component.scss' ]
 })
 export class ActorAvatarInfoComponent {
-  @ViewChild('avatarfileInput') avatarfileInput
+  @ViewChild('avatarfileInput') avatarfileInput: ElementRef<HTMLInputElement>
 
   @Input() actor: VideoChannel | Account
 
   @Output() avatarChange = new EventEmitter<FormData>()
 
   constructor (
-    private userService: UserService,
-    private authService: AuthService,
     private serverService: ServerService,
-    private notificationsService: NotificationsService
+    private notifier: Notifier
   ) {}
 
   onAvatarChange () {
     const avatarfile = this.avatarfileInput.nativeElement.files[ 0 ]
     if (avatarfile.size > this.maxAvatarSize) {
-      this.notificationsService.error('Error', 'This image is too large.')
+      this.notifier.error('Error', 'This image is too large.')
       return
     }