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.ts11
1 files changed, 8 insertions, 3 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 b7556c13e..67726afdc 100644
--- a/client/src/app/videos/video-list/video-search.component.ts
+++ b/client/src/app/videos/video-list/video-search.component.ts
@@ -16,7 +16,9 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
16 currentRoute = '/videos/search' 16 currentRoute = '/videos/search'
17 loadOnInit = false 17 loadOnInit = false
18 18
19 private search = '' 19 protected otherParams = {
20 search: ''
21 }
20 private subActivatedRoute: Subscription 22 private subActivatedRoute: Subscription
21 23
22 constructor (protected router: Router, 24 constructor (protected router: Router,
@@ -32,7 +34,10 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
32 34
33 this.subActivatedRoute = this.route.queryParams.subscribe( 35 this.subActivatedRoute = this.route.queryParams.subscribe(
34 queryParams => { 36 queryParams => {
35 this.search = queryParams['search'] 37 const querySearch = queryParams['search']
38 if (!querySearch || this.otherParams.search === querySearch) return
39
40 this.otherParams.search = querySearch
36 this.reloadVideos() 41 this.reloadVideos()
37 }, 42 },
38 43
@@ -47,6 +52,6 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
47 } 52 }
48 53
49 getVideosObservable () { 54 getVideosObservable () {
50 return this.videoService.searchVideos(this.search, this.pagination, this.sort) 55 return this.videoService.searchVideos(this.otherParams.search, this.pagination, this.sort)
51 } 56 }
52} 57}