diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-27 17:10:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-27 17:10:56 +0200 |
commit | 5b5e333f068c7bd5fcf519bcd3f687eb46221883 (patch) | |
tree | 951a8f6382dba0ada7511454c55bfa4384864507 | |
parent | d414207f07f47307947d86d5bc5c5fc0ae73be18 (diff) | |
download | PeerTube-5b5e333f068c7bd5fcf519bcd3f687eb46221883.tar.gz PeerTube-5b5e333f068c7bd5fcf519bcd3f687eb46221883.tar.zst PeerTube-5b5e333f068c7bd5fcf519bcd3f687eb46221883.zip |
Fix videos list params
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 4 | ||||
-rw-r--r-- | client/src/app/videos/video-list/video-search.component.ts | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index c18ebcf54..90a88544a 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -54,7 +54,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
54 | 54 | ||
55 | ngOnInit () { | 55 | ngOnInit () { |
56 | // Subscribe to route changes | 56 | // Subscribe to route changes |
57 | const routeParams = this.route.snapshot.params | 57 | const routeParams = this.route.snapshot.queryParams |
58 | this.loadRouteParams(routeParams) | 58 | this.loadRouteParams(routeParams) |
59 | 59 | ||
60 | this.resizeSubscription = fromEvent(window, 'resize') | 60 | this.resizeSubscription = fromEvent(window, 'resize') |
@@ -162,7 +162,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
162 | 162 | ||
163 | protected setNewRouteParams () { | 163 | protected setNewRouteParams () { |
164 | const routeParams = this.buildRouteParams() | 164 | const routeParams = this.buildRouteParams() |
165 | this.router.navigate([ this.currentRoute, routeParams ]) | 165 | this.router.navigate([ this.currentRoute ], { queryParams: routeParams }) |
166 | } | 166 | } |
167 | 167 | ||
168 | protected buildVideoPages () { | 168 | protected buildVideoPages () { |
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 67857a0a9..b94be8e11 100644 --- a/client/src/app/videos/video-list/video-search.component.ts +++ b/client/src/app/videos/video-list/video-search.component.ts | |||
@@ -39,6 +39,7 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O | |||
39 | this.subActivatedRoute = this.route.queryParams.subscribe( | 39 | this.subActivatedRoute = this.route.queryParams.subscribe( |
40 | queryParams => { | 40 | queryParams => { |
41 | const querySearch = queryParams['search'] | 41 | const querySearch = queryParams['search'] |
42 | |||
42 | if (!querySearch) return this.redirectService.redirectToHomepage() | 43 | if (!querySearch) return this.redirectService.redirectToHomepage() |
43 | if (this.otherRouteParams.search === querySearch) return | 44 | if (this.otherRouteParams.search === querySearch) return |
44 | 45 | ||