X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fuser-subscription%2Fsubscribe-button.component.ts;h=8f1754c7f31ececd86134531f0d391e31b1edf96;hb=f8b2c1b4f509c037b9650cca2c5befd21f056df3;hp=9c8a15023e39005198c162c5bc7df400043a39dc;hpb=e0e665f0efa98f2701dd9f5529e99989680481ae;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/user-subscription/subscribe-button.component.ts index 9c8a15023..8f1754c7f 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/user-subscription/subscribe-button.component.ts @@ -1,9 +1,8 @@ import { Component, Input, OnInit } from '@angular/core' import { Router } from '@angular/router' -import { AuthService } from '@app/core' +import { AuthService, Notifier } from '@app/core' import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' -import { NotificationsService } from 'angular2-notifications' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoService } from '@app/shared/video/video.service' import { FeedFormat } from '../../../../../shared/models/feeds' @@ -23,7 +22,7 @@ export class SubscribeButtonComponent implements OnInit { constructor ( private authService: AuthService, private router: Router, - private notificationsService: NotificationsService, + private notifier: Notifier, private userSubscriptionService: UserSubscriptionService, private i18n: I18n, private videoService: VideoService @@ -43,7 +42,7 @@ export class SubscribeButtonComponent implements OnInit { .subscribe( res => this.subscribed = res[this.uri], - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) } } @@ -62,13 +61,13 @@ export class SubscribeButtonComponent implements OnInit { () => { this.subscribed = true - this.notificationsService.success( - this.i18n('Subscribed'), - this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }) + this.notifier.success( + this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }), + this.i18n('Subscribed') ) }, - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) } @@ -84,13 +83,13 @@ export class SubscribeButtonComponent implements OnInit { () => { this.subscribed = false - this.notificationsService.success( - this.i18n('Unsubscribed'), - this.i18n('Unsubscribed from {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }) + this.notifier.success( + this.i18n('Unsubscribed from {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }), + this.i18n('Unsubscribed') ) }, - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) }