aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-history/my-account-history.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-19 16:04:34 +0100
committerChocobozzz <me@florianbigard.com>2018-12-19 17:26:52 +0100
commitf8b2c1b4f509c037b9650cca2c5befd21f056df3 (patch)
tree89d278f9628d657e6aad1b1e15febaf8ff9fcfa9 /client/src/app/+my-account/my-account-history/my-account-history.component.ts
parente0e665f0efa98f2701dd9f5529e99989680481ae (diff)
downloadPeerTube-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-history/my-account-history.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-history/my-account-history.component.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.ts b/client/src/app/+my-account/my-account-history/my-account-history.component.ts
index 6ec4fefe8..394091bad 100644
--- a/client/src/app/+my-account/my-account-history/my-account-history.component.ts
+++ b/client/src/app/+my-account/my-account-history/my-account-history.component.ts
@@ -3,7 +3,6 @@ import { ActivatedRoute, Router } from '@angular/router'
3import { Location } from '@angular/common' 3import { Location } from '@angular/common'
4import { immutableAssign } from '@app/shared/misc/utils' 4import { immutableAssign } from '@app/shared/misc/utils'
5import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 5import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
6import { NotificationsService } from 'angular2-notifications'
7import { AuthService } from '../../core/auth' 6import { AuthService } from '../../core/auth'
8import { ConfirmService } from '../../core/confirm' 7import { ConfirmService } from '../../core/confirm'
9import { AbstractVideoList } from '../../shared/video/abstract-video-list' 8import { AbstractVideoList } from '../../shared/video/abstract-video-list'
@@ -12,6 +11,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
12import { ScreenService } from '@app/shared/misc/screen.service' 11import { ScreenService } from '@app/shared/misc/screen.service'
13import { UserHistoryService } from '@app/shared/users/user-history.service' 12import { UserHistoryService } from '@app/shared/users/user-history.service'
14import { UserService } from '@app/shared' 13import { UserService } from '@app/shared'
14import { Notifier } from '@app/core'
15 15
16@Component({ 16@Component({
17 selector: 'my-account-history', 17 selector: 'my-account-history',
@@ -36,7 +36,7 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn
36 protected route: ActivatedRoute, 36 protected route: ActivatedRoute,
37 protected authService: AuthService, 37 protected authService: AuthService,
38 protected userService: UserService, 38 protected userService: UserService,
39 protected notificationsService: NotificationsService, 39 protected notifier: Notifier,
40 protected location: Location, 40 protected location: Location,
41 protected screenService: ScreenService, 41 protected screenService: ScreenService,
42 protected i18n: I18n, 42 protected i18n: I18n,
@@ -77,12 +77,12 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn
77 this.i18n('Videos history is enabled') : 77 this.i18n('Videos history is enabled') :
78 this.i18n('Videos history is disabled') 78 this.i18n('Videos history is disabled')
79 79
80 this.notificationsService.success(this.i18n('Success'), message) 80 this.notifier.success(message)
81 81
82 this.authService.refreshUserInformation() 82 this.authService.refreshUserInformation()
83 }, 83 },
84 84
85 err => this.notificationsService.error(this.i18n('Error'), err.message) 85 err => this.notifier.error(err.message)
86 ) 86 )
87 } 87 }
88 88
@@ -96,12 +96,12 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn
96 this.userHistoryService.deleteUserVideosHistory() 96 this.userHistoryService.deleteUserVideosHistory()
97 .subscribe( 97 .subscribe(
98 () => { 98 () => {
99 this.notificationsService.success(this.i18n('Success'), this.i18n('Videos history deleted')) 99 this.notifier.success(this.i18n('Videos history deleted'))
100 100
101 this.reloadVideos() 101 this.reloadVideos()
102 }, 102 },
103 103
104 err => this.notificationsService.error(this.i18n('Error'), err.message) 104 err => this.notifier.error(err.message)
105 ) 105 )
106 } 106 }
107} 107}