Fix videos list params
This commit is contained in:
parent
d414207f07
commit
5b5e333f06
|
@ -54,7 +54,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
// Subscribe to route changes
|
// Subscribe to route changes
|
||||||
const routeParams = this.route.snapshot.params
|
const routeParams = this.route.snapshot.queryParams
|
||||||
this.loadRouteParams(routeParams)
|
this.loadRouteParams(routeParams)
|
||||||
|
|
||||||
this.resizeSubscription = fromEvent(window, 'resize')
|
this.resizeSubscription = fromEvent(window, 'resize')
|
||||||
|
@ -162,7 +162,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
|
|
||||||
protected setNewRouteParams () {
|
protected setNewRouteParams () {
|
||||||
const routeParams = this.buildRouteParams()
|
const routeParams = this.buildRouteParams()
|
||||||
this.router.navigate([ this.currentRoute, routeParams ])
|
this.router.navigate([ this.currentRoute ], { queryParams: routeParams })
|
||||||
}
|
}
|
||||||
|
|
||||||
protected buildVideoPages () {
|
protected buildVideoPages () {
|
||||||
|
|
|
@ -39,6 +39,7 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
|
||||||
this.subActivatedRoute = this.route.queryParams.subscribe(
|
this.subActivatedRoute = this.route.queryParams.subscribe(
|
||||||
queryParams => {
|
queryParams => {
|
||||||
const querySearch = queryParams['search']
|
const querySearch = queryParams['search']
|
||||||
|
|
||||||
if (!querySearch) return this.redirectService.redirectToHomepage()
|
if (!querySearch) return this.redirectService.redirectToHomepage()
|
||||||
if (this.otherRouteParams.search === querySearch) return
|
if (this.otherRouteParams.search === querySearch) return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue