]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts
Refractor notification service
[github/Chocobozzz/PeerTube.git] / client / src / app / +verify-account / verify-account-email / verify-account-email.component.ts
index 26b3bf4b1dcc473f4bfea1e47763e8f08c6eaf2d..f9ecf664b9e613421982f19fcf9c6bae5a59c710 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { I18n } from '@ngx-translate/i18n-polyfill'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
 import { UserService } from '@app/shared'
 
 @Component({
@@ -17,7 +17,7 @@ export class VerifyAccountEmailComponent implements OnInit {
 
   constructor (
     private userService: UserService,
-    private notificationsService: NotificationsService,
+    private notifier: Notifier,
     private router: Router,
     private route: ActivatedRoute,
     private i18n: I18n
@@ -25,12 +25,11 @@ export class VerifyAccountEmailComponent implements OnInit {
   }
 
   ngOnInit () {
-
     this.userId = this.route.snapshot.queryParams['userId']
     this.verificationString = this.route.snapshot.queryParams['verificationString']
 
     if (!this.userId || !this.verificationString) {
-      this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.'))
+      this.notifier.error(this.i18n('Unable to find user id or verification string.'))
     } else {
       this.verifyEmail()
     }
@@ -47,7 +46,7 @@ export class VerifyAccountEmailComponent implements OnInit {
         },
 
         err => {
-          this.notificationsService.error(this.i18n('Error'), err.message)
+          this.notifier.error(err.message)
         }
       )
   }