X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fsearch%2Fsearch.component.ts;h=474b728244867b58c6dfacac9e128cb087d060ad;hb=f8b2c1b4f509c037b9650cca2c5befd21f056df3;hp=ecffcafc1ff09621804704cf4ecddaef5a18148d;hpb=bb5d90e62f631af3c899fbe586485e64938a5927;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index ecffcafc1..474b72824 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts @@ -1,7 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService } from '@app/core' -import { NotificationsService } from 'angular2-notifications' +import { AuthService, Notifier } from '@app/core' import { forkJoin, Subscription } from 'rxjs' import { SearchService } from '@app/search/search.service' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' @@ -40,7 +39,7 @@ export class SearchComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private router: Router, private metaService: MetaService, - private notificationsService: NotificationsService, + private notifier: Notifier, private searchService: SearchService, private authService: AuthService ) { } @@ -68,7 +67,7 @@ export class SearchComponent implements OnInit, OnDestroy { this.search() }, - err => this.notificationsService.error('Error', err.text) + err => this.notifier.error(err.text) ) } @@ -112,9 +111,7 @@ export class SearchComponent implements OnInit, OnDestroy { this.firstSearch = false }, - error => { - this.notificationsService.error(this.i18n('Error'), error.message) - } + err => this.notifier.error(err.message) ) } @@ -146,7 +143,8 @@ export class SearchComponent implements OnInit, OnDestroy { } private updateTitle () { - this.metaService.setTitle(this.i18n('Search') + ' ' + this.currentSearch) + const suffix = this.currentSearch ? ' ' + this.currentSearch : '' + this.metaService.setTitle(this.i18n('Search') + suffix) } private updateUrlFromAdvancedSearch () {