]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts
Fix broken views on mobile and small screens (#2671)
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-blocklist / my-account-server-blocklist.component.ts
index b411d6926bfe8b8bc6b82a1de07df30ce57d7aa9..9049dc69c073d7391a16f4c231b02a42e0c8887a 100644 (file)
@@ -1,8 +1,8 @@
 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'
+import { SortMeta } from 'primeng/api'
 import { ServerBlock } from '../../../../../shared'
 import { BlocklistService } from '@app/shared/blocklist'
 
@@ -19,7 +19,7 @@ export class MyAccountServerBlocklistComponent extends RestTable implements OnIn
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
   constructor (
-    private notificationsService: NotificationsService,
+    private notifier: Notifier,
     private blocklistService: BlocklistService,
     private i18n: I18n
   ) {
@@ -30,16 +30,17 @@ export class MyAccountServerBlocklistComponent extends RestTable implements OnIn
     this.initialize()
   }
 
+  getIdentifier () {
+    return 'MyAccountServerBlocklistComponent'
+  }
+
   unblockServer (serverBlock: ServerBlock) {
     const host = serverBlock.blockedServer.host
 
     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()
         }
@@ -54,7 +55,7 @@ export class MyAccountServerBlocklistComponent extends RestTable implements OnIn
           this.totalRecords = resultList.total
         },
 
-        err => this.notificationsService.error(this.i18n('Error'), err.message)
+        err => this.notifier.error(err.message)
       )
   }
 }