]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-blocklist / my-account-server-blocklist.component.ts
index b994c2c9937c2a7e2d212dfd6f5dca480411786f..4c5cc28b89c8187c9f4ad35615c20bf091a041bc 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
 import { I18n } from '@ngx-translate/i18n-polyfill'
 import { RestPagination, RestTable } from '@app/shared'
 import { SortMeta } from 'primeng/components/common/sortmeta'
@@ -12,14 +12,14 @@ import { BlocklistService } from '@app/shared/blocklist'
   templateUrl: './my-account-server-blocklist.component.html'
 })
 export class MyAccountServerBlocklistComponent extends RestTable implements OnInit {
-  blockedAccounts: ServerBlock[] = []
+  blockedServers: ServerBlock[] = []
   totalRecords = 0
   rowsPerPage = 10
   sort: SortMeta = { field: 'createdAt', order: -1 }
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
   constructor (
-    private notificationsService: NotificationsService,
+    private notifier: Notifier,
     private blocklistService: BlocklistService,
     private i18n: I18n
   ) {
@@ -36,10 +36,7 @@ export class MyAccountServerBlocklistComponent extends RestTable implements OnIn
     this.blocklistService.unblockServerByUser(host)
       .subscribe(
         () => {
-          this.notificationsService.success(
-            this.i18n('Success'),
-            this.i18n('Instance {{host}} unmuted.', { host })
-          )
+          this.notifier.success(this.i18n('Instance {{host}} unmuted.', { host }))
 
           this.loadData()
         }
@@ -50,11 +47,11 @@ export class MyAccountServerBlocklistComponent extends RestTable implements OnIn
     return this.blocklistService.getUserServerBlocklist(this.pagination, this.sort)
       .subscribe(
         resultList => {
-          this.blockedAccounts = resultList.data
+          this.blockedServers = resultList.data
           this.totalRecords = resultList.total
         },
 
-        err => this.notificationsService.error(this.i18n('Error'), err.message)
+        err => this.notifier.error(err.message)
       )
   }
 }