]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/followers-list/followers-list.component.ts
Merge branch 'release/v1.0.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / followers-list / followers-list.component.ts
index 8dc2d9317c893d3e798d5f29e8d0a07d0bb1b900..4a25b7ff32075c7c4d6d52517d1644ec26a17c6f 100644 (file)
@@ -1,18 +1,19 @@
-import { Component } from '@angular/core'
+import { Component, OnInit } from '@angular/core'
 
 import { NotificationsService } from 'angular2-notifications'
 import { SortMeta } from 'primeng/primeng'
-import { AccountFollow } from '../../../../../../shared/models/accounts/follow.model'
+import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
 import { RestPagination, RestTable } from '../../../shared'
 import { FollowService } from '../shared'
+import { I18n } from '@ngx-translate/i18n-polyfill'
 
 @Component({
   selector: 'my-followers-list',
   templateUrl: './followers-list.component.html',
   styleUrls: [ './followers-list.component.scss' ]
 })
-export class FollowersListComponent extends RestTable {
-  followers: AccountFollow[] = []
+export class FollowersListComponent extends RestTable implements OnInit {
+  followers: ActorFollow[] = []
   totalRecords = 0
   rowsPerPage = 10
   sort: SortMeta = { field: 'createdAt', order: 1 }
@@ -20,11 +21,16 @@ export class FollowersListComponent extends RestTable {
 
   constructor (
     private notificationsService: NotificationsService,
-    private followService: FollowService
+    private followService: FollowService,
+    private i18n: I18n
   ) {
     super()
   }
 
+  ngOnInit () {
+    this.initialize()
+  }
+
   protected loadData () {
     this.followService.getFollowers(this.pagination, this.sort)
                       .subscribe(
@@ -33,7 +39,7 @@ export class FollowersListComponent extends RestTable {
                           this.totalRecords = resultList.total
                         },
 
-                        err => this.notificationsService.error('Error', err.message)
+                        err => this.notificationsService.error(this.i18n('Error'), err.message)
                       )
   }
 }