diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-29 09:30:06 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-29 09:30:06 +0100 |
commit | c88593f72f1097cc34a091b4cb4b6d6e214d1e9f (patch) | |
tree | 23c78f45ac3029bf8e3cf224f1f8cf9e27a3e944 /client/src/app/videos | |
parent | e8395f027b6c3e3f757c740e35b20e76c51b03bd (diff) | |
download | PeerTube-c88593f72f1097cc34a091b4cb4b6d6e214d1e9f.tar.gz PeerTube-c88593f72f1097cc34a091b4cb4b6d6e214d1e9f.tar.zst PeerTube-c88593f72f1097cc34a091b4cb4b6d6e214d1e9f.zip |
Fix search pagination
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/video-list/video-search.component.ts | 11 |
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 | } |