]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
variable columns for users list, more columns possible, badge display for statuses
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / shared / redundancy-checkbox.component.ts
index 6d77a0eb4364f26eab40e5f6a00d50c3e001fd32..662143abcf0713ba784eef8ae50a68fb6d19970e 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, Input } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
+import { RedundancyService } from '@app/shared/shared-main'
 import { I18n } from '@ngx-translate/i18n-polyfill'
-import { RedundancyService } from '@app/+admin/follows/shared/redundancy.service'
 
 @Component({
   selector: 'my-redundancy-checkbox',
@@ -13,24 +13,21 @@ export class RedundancyCheckboxComponent {
   @Input() host: string
 
   constructor (
-    private notificationsService: NotificationsService,
+    private notifier: Notifier,
     private redundancyService: RedundancyService,
     private i18n: I18n
   ) { }
 
   updateRedundancyState () {
     this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed)
-      .subscribe(
-        () => {
-          const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled')
+        .subscribe(
+          () => {
+            const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled')
 
-          this.notificationsService.success(
-            this.i18n('Success'),
-            this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel })
-          )
-        },
+            this.notifier.success(this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel }))
+          },
 
-          err => this.notificationsService.error(this.i18n('Error'), err.message)
-      )
+          err => this.notifier.error(err.message)
+        )
   }
 }