aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search
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/search
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/search')
-rw-r--r--client/src/app/search/search-filters.component.ts6
-rw-r--r--client/src/app/search/search.component.ts11
2 files changed, 5 insertions, 12 deletions
diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts
index 8d7f84ac1..3fdc6df35 100644
--- a/client/src/app/search/search-filters.component.ts
+++ b/client/src/app/search/search-filters.component.ts
@@ -1,10 +1,6 @@
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 2import { ServerService } from '@app/core'
3import { RedirectService, ServerService } from '@app/core'
4import { NotificationsService } from 'angular2-notifications'
5import { SearchService } from '@app/search/search.service'
6import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
7import { MetaService } from '@ngx-meta/core'
8import { AdvancedSearch } from '@app/search/advanced-search.model' 4import { AdvancedSearch } from '@app/search/advanced-search.model'
9import { VideoConstant } from '../../../../shared' 5import { VideoConstant } from '../../../../shared'
10 6
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 3d17e6d96..474b72824 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -1,7 +1,6 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { NotificationsService } from 'angular2-notifications'
5import { forkJoin, Subscription } from 'rxjs' 4import { forkJoin, Subscription } from 'rxjs'
6import { SearchService } from '@app/search/search.service' 5import { SearchService } from '@app/search/search.service'
7import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 6import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
@@ -40,7 +39,7 @@ export class SearchComponent implements OnInit, OnDestroy {
40 private route: ActivatedRoute, 39 private route: ActivatedRoute,
41 private router: Router, 40 private router: Router,
42 private metaService: MetaService, 41 private metaService: MetaService,
43 private notificationsService: NotificationsService, 42 private notifier: Notifier,
44 private searchService: SearchService, 43 private searchService: SearchService,
45 private authService: AuthService 44 private authService: AuthService
46 ) { } 45 ) { }
@@ -68,7 +67,7 @@ export class SearchComponent implements OnInit, OnDestroy {
68 this.search() 67 this.search()
69 }, 68 },
70 69
71 err => this.notificationsService.error('Error', err.text) 70 err => this.notifier.error(err.text)
72 ) 71 )
73 } 72 }
74 73
@@ -112,9 +111,7 @@ export class SearchComponent implements OnInit, OnDestroy {
112 this.firstSearch = false 111 this.firstSearch = false
113 }, 112 },
114 113
115 error => { 114 err => this.notifier.error(err.message)
116 this.notificationsService.error(this.i18n('Error'), error.message)
117 }
118 ) 115 )
119 116
120 } 117 }