aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/video-list/video-search.component.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/videos/video-list/video-search.component.ts b/client/src/app/videos/video-list/video-search.component.ts
index 788797a4c..67857a0a9 100644
--- a/client/src/app/videos/video-list/video-search.component.ts
+++ b/client/src/app/videos/video-list/video-search.component.ts
@@ -1,5 +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 { RedirectService } from '@app/core'
3import { immutableAssign } from '@app/shared/misc/utils' 4import { immutableAssign } from '@app/shared/misc/utils'
4import { NotificationsService } from 'angular2-notifications' 5import { NotificationsService } from 'angular2-notifications'
5import { Subscription } from 'rxjs/Subscription' 6import { Subscription } from 'rxjs/Subscription'
@@ -26,7 +27,9 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
26 protected route: ActivatedRoute, 27 protected route: ActivatedRoute,
27 protected notificationsService: NotificationsService, 28 protected notificationsService: NotificationsService,
28 protected authService: AuthService, 29 protected authService: AuthService,
29 private videoService: VideoService) { 30 private videoService: VideoService,
31 private redirectService: RedirectService
32 ) {
30 super() 33 super()
31 } 34 }
32 35
@@ -36,7 +39,8 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
36 this.subActivatedRoute = this.route.queryParams.subscribe( 39 this.subActivatedRoute = this.route.queryParams.subscribe(
37 queryParams => { 40 queryParams => {
38 const querySearch = queryParams['search'] 41 const querySearch = queryParams['search']
39 if (!querySearch || this.otherRouteParams.search === querySearch) return 42 if (!querySearch) return this.redirectService.redirectToHomepage()
43 if (this.otherRouteParams.search === querySearch) return
40 44
41 this.otherRouteParams.search = querySearch 45 this.otherRouteParams.search = querySearch
42 this.reloadVideos() 46 this.reloadVideos()