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/+accounts | |
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/+accounts')
-rw-r--r-- | client/src/app/+accounts/account-videos/account-videos.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts index e5c1f58b0..13b634a01 100644 --- a/client/src/app/+accounts/account-videos/account-videos.component.ts +++ b/client/src/app/+accounts/account-videos/account-videos.component.ts | |||
@@ -2,7 +2,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core' | |||
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { Location } from '@angular/common' | 3 | import { Location } from '@angular/common' |
4 | import { immutableAssign } from '@app/shared/misc/utils' | 4 | import { immutableAssign } from '@app/shared/misc/utils' |
5 | import { NotificationsService } from 'angular2-notifications' | ||
6 | import { AuthService } from '../../core/auth' | 5 | import { AuthService } from '../../core/auth' |
7 | import { ConfirmService } from '../../core/confirm' | 6 | import { ConfirmService } from '../../core/confirm' |
8 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 7 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
@@ -13,6 +12,7 @@ import { tap } from 'rxjs/operators' | |||
13 | import { I18n } from '@ngx-translate/i18n-polyfill' | 12 | import { I18n } from '@ngx-translate/i18n-polyfill' |
14 | import { Subscription } from 'rxjs' | 13 | import { Subscription } from 'rxjs' |
15 | import { ScreenService } from '@app/shared/misc/screen.service' | 14 | import { ScreenService } from '@app/shared/misc/screen.service' |
15 | import { Notifier } from '@app/core' | ||
16 | 16 | ||
17 | @Component({ | 17 | @Component({ |
18 | selector: 'my-account-videos', | 18 | selector: 'my-account-videos', |
@@ -35,7 +35,7 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit, | |||
35 | protected router: Router, | 35 | protected router: Router, |
36 | protected route: ActivatedRoute, | 36 | protected route: ActivatedRoute, |
37 | protected authService: AuthService, | 37 | protected authService: AuthService, |
38 | protected notificationsService: NotificationsService, | 38 | protected notifier: Notifier, |
39 | protected confirmService: ConfirmService, | 39 | protected confirmService: ConfirmService, |
40 | protected location: Location, | 40 | protected location: Location, |
41 | protected screenService: ScreenService, | 41 | protected screenService: ScreenService, |
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index e19927d6b..036264602 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -5,10 +5,9 @@ import { Account } from '@app/shared/account/account.model' | |||
5 | import { RestExtractor, UserService } from '@app/shared' | 5 | import { RestExtractor, UserService } from '@app/shared' |
6 | import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' | 6 | import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' |
7 | import { Subscription } from 'rxjs' | 7 | import { Subscription } from 'rxjs' |
8 | import { NotificationsService } from 'angular2-notifications' | 8 | import { AuthService, Notifier, RedirectService } from '@app/core' |
9 | import { User, UserRight } from '../../../../shared' | 9 | import { User, UserRight } from '../../../../shared' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { AuthService, RedirectService } from '@app/core' | ||
12 | 11 | ||
13 | @Component({ | 12 | @Component({ |
14 | templateUrl: './accounts.component.html', | 13 | templateUrl: './accounts.component.html', |
@@ -24,7 +23,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
24 | private route: ActivatedRoute, | 23 | private route: ActivatedRoute, |
25 | private userService: UserService, | 24 | private userService: UserService, |
26 | private accountService: AccountService, | 25 | private accountService: AccountService, |
27 | private notificationsService: NotificationsService, | 26 | private notifier: Notifier, |
28 | private restExtractor: RestExtractor, | 27 | private restExtractor: RestExtractor, |
29 | private redirectService: RedirectService, | 28 | private redirectService: RedirectService, |
30 | private authService: AuthService, | 29 | private authService: AuthService, |
@@ -43,7 +42,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
43 | .subscribe( | 42 | .subscribe( |
44 | account => this.account = account, | 43 | account => this.account = account, |
45 | 44 | ||
46 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 45 | err => this.notifier.error(err.message) |
47 | ) | 46 | ) |
48 | } | 47 | } |
49 | 48 | ||
@@ -69,7 +68,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
69 | .subscribe( | 68 | .subscribe( |
70 | user => this.user = user, | 69 | user => this.user = user, |
71 | 70 | ||
72 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 71 | err => this.notifier.error(err.message) |
73 | ) | 72 | ) |
74 | } | 73 | } |
75 | } | 74 | } |