diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-19 16:04:34 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-19 17:26:52 +0100 |
commit | f8b2c1b4f509c037b9650cca2c5befd21f056df3 (patch) | |
tree | 89d278f9628d657e6aad1b1e15febaf8ff9fcfa9 /client/src/app/+my-account/my-account-videos/video-change-ownership | |
parent | e0e665f0efa98f2701dd9f5529e99989680481ae (diff) | |
download | PeerTube-f8b2c1b4f509c037b9650cca2c5befd21f056df3.tar.gz PeerTube-f8b2c1b4f509c037b9650cca2c5befd21f056df3.tar.zst PeerTube-f8b2c1b4f509c037b9650cca2c5befd21f056df3.zip |
Refractor notification service
Shorter name and use primeng component
Diffstat (limited to 'client/src/app/+my-account/my-account-videos/video-change-ownership')
-rw-r--r-- | client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts index 9f94f3c13..37d7cf2a4 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts +++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { FormReactive, UserService } from '../../../shared/index' | 4 | import { FormReactive, UserService } from '../../../shared/index' |
5 | import { Video } from '@app/shared/video/video.model' | 5 | import { Video } from '@app/shared/video/video.model' |
@@ -25,7 +25,7 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
25 | protected formValidatorService: FormValidatorService, | 25 | protected formValidatorService: FormValidatorService, |
26 | private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService, | 26 | private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService, |
27 | private videoOwnershipService: VideoOwnershipService, | 27 | private videoOwnershipService: VideoOwnershipService, |
28 | private notificationsService: NotificationsService, | 28 | private notifier: Notifier, |
29 | private userService: UserService, | 29 | private userService: UserService, |
30 | private modalService: NgbModal, | 30 | private modalService: NgbModal, |
31 | private i18n: I18n | 31 | private i18n: I18n |
@@ -53,11 +53,9 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
53 | const query = event.query | 53 | const query = event.query |
54 | this.userService.autocomplete(query) | 54 | this.userService.autocomplete(query) |
55 | .subscribe( | 55 | .subscribe( |
56 | usernames => { | 56 | usernames => this.usernamePropositions = usernames, |
57 | this.usernamePropositions = usernames | ||
58 | }, | ||
59 | 57 | ||
60 | err => this.notificationsService.error('Error', err.message) | 58 | err => this.notifier.error(err.message) |
61 | ) | 59 | ) |
62 | } | 60 | } |
63 | 61 | ||
@@ -67,9 +65,9 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
67 | this.videoOwnershipService | 65 | this.videoOwnershipService |
68 | .changeOwnership(this.video.id, username) | 66 | .changeOwnership(this.video.id, username) |
69 | .subscribe( | 67 | .subscribe( |
70 | () => this.notificationsService.success(this.i18n('Success'), this.i18n('Ownership change request sent.')), | 68 | () => this.notifier.success(this.i18n('Ownership change request sent.')), |
71 | 69 | ||
72 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 70 | err => this.notifier.error(err.message) |
73 | ) | 71 | ) |
74 | } | 72 | } |
75 | } | 73 | } |